From 75635b01a44852fd1fc6b2f23db6c53e68f5c7a2 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 10 Sep 2020 03:08:11 +0000 Subject: [PATCH] Generated from 12d501127674d8c25f990aacdbbc520a2ec6593d update readme.java.md --- .../network/_network_management_client.py | 736 +- .../azure/mgmt/network/_operations_mixin.py | 292 +- .../aio/_network_management_client_async.py | 736 +- .../network/aio/_operations_mixin_async.py | 306 +- .../azure/mgmt/network/models.py | 1 + .../mgmt/network/v2015_06_15/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 54 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 76 +- ...oute_service_providers_operations_async.py | 12 +- .../_load_balancers_operations_async.py | 40 +- ...local_network_gateways_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 65 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 40 +- .../_public_ip_addresses_operations_async.py | 40 +- .../_route_tables_operations_async.py | 40 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 48 +- ...rtual_network_gateways_operations_async.py | 46 +- .../_virtual_networks_operations_async.py | 40 +- .../_application_gateways_operations.py | 38 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 68 +- ...ress_route_service_providers_operations.py | 12 +- .../operations/_load_balancers_operations.py | 32 +- .../_local_network_gateways_operations.py | 20 +- .../_network_interfaces_operations.py | 57 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 32 +- .../_public_ip_addresses_operations.py | 32 +- .../operations/_route_tables_operations.py | 32 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 32 +- .../_virtual_network_gateways_operations.py | 30 +- .../_virtual_networks_operations.py | 32 +- .../mgmt/network/v2016_09_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 65 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 75 +- ...oute_service_providers_operations_async.py | 12 +- .../_load_balancers_operations_async.py | 40 +- ...local_network_gateways_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 87 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 40 +- .../_network_watchers_operations_async.py | 91 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 40 +- .../_route_tables_operations_async.py | 40 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 48 +- ...rtual_network_gateways_operations_async.py | 79 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 41 +- .../_application_gateways_operations.py | 45 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 55 +- ...ress_route_service_providers_operations.py | 12 +- .../operations/_load_balancers_operations.py | 32 +- .../_local_network_gateways_operations.py | 20 +- .../_network_interfaces_operations.py | 71 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 32 +- .../_network_watchers_operations.py | 59 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 32 +- .../operations/_route_tables_operations.py | 32 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 32 +- .../_virtual_network_gateways_operations.py | 51 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 33 +- .../mgmt/network/v2016_12_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 65 +- ...gp_service_communities_operations_async.py | 12 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 75 +- ...oute_service_providers_operations_async.py | 12 +- .../_load_balancers_operations_async.py | 40 +- ...local_network_gateways_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 87 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 40 +- .../_network_watchers_operations_async.py | 91 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 40 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 40 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 48 +- ...rtual_network_gateways_operations_async.py | 79 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 41 +- .../_application_gateways_operations.py | 45 +- .../_bgp_service_communities_operations.py | 12 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 55 +- ...ress_route_service_providers_operations.py | 12 +- .../operations/_load_balancers_operations.py | 32 +- .../_local_network_gateways_operations.py | 20 +- .../_network_interfaces_operations.py | 71 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 32 +- .../_network_watchers_operations.py | 59 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 32 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 32 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 32 +- .../_virtual_network_gateways_operations.py | 51 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 33 +- .../mgmt/network/v2017_03_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 66 +- ...gp_service_communities_operations_async.py | 12 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 75 +- ...oute_service_providers_operations_async.py | 12 +- .../_load_balancers_operations_async.py | 40 +- ...local_network_gateways_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 87 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 40 +- .../_network_watchers_operations_async.py | 99 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 65 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 40 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 48 +- ...rtual_network_gateways_operations_async.py | 79 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 53 +- .../_application_gateways_operations.py | 46 +- .../_bgp_service_communities_operations.py | 12 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 55 +- ...ress_route_service_providers_operations.py | 12 +- .../operations/_load_balancers_operations.py | 32 +- .../_local_network_gateways_operations.py | 20 +- .../_network_interfaces_operations.py | 71 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 32 +- .../_network_watchers_operations.py | 63 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 57 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 32 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 32 +- .../_virtual_network_gateways_operations.py | 51 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 45 +- .../mgmt/network/v2017_06_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 80 +- ...able_endpoint_services_operations_async.py | 12 +- ...gp_service_communities_operations_async.py | 12 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 75 +- ...oute_service_providers_operations_async.py | 12 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 40 +- ...local_network_gateways_operations_async.py | 28 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 87 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 40 +- .../_network_watchers_operations_async.py | 99 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 65 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 40 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 48 +- ...rtual_network_gateways_operations_async.py | 102 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 53 +- .../_application_gateways_operations.py | 60 +- ..._available_endpoint_services_operations.py | 12 +- .../_bgp_service_communities_operations.py | 12 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 55 +- ...ress_route_service_providers_operations.py | 12 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 32 +- .../_local_network_gateways_operations.py | 20 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 71 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 32 +- .../_network_watchers_operations.py | 63 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 57 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 32 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 32 +- .../_virtual_network_gateways_operations.py | 70 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 45 +- .../mgmt/network/v2017_08_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 80 +- ...able_endpoint_services_operations_async.py | 12 +- ...gp_service_communities_operations_async.py | 12 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 75 +- ...oute_service_providers_operations_async.py | 12 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 40 +- ...local_network_gateways_operations_async.py | 28 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 87 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 40 +- .../_network_watchers_operations_async.py | 99 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 65 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 40 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 48 +- ...rtual_network_gateways_operations_async.py | 117 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 53 +- .../_application_gateways_operations.py | 60 +- ..._available_endpoint_services_operations.py | 12 +- .../_bgp_service_communities_operations.py | 12 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 55 +- ...ress_route_service_providers_operations.py | 12 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 32 +- .../_local_network_gateways_operations.py | 20 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 71 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 32 +- .../_network_watchers_operations.py | 63 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 57 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 32 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 32 +- .../_virtual_network_gateways_operations.py | 81 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 45 +- .../mgmt/network/v2017_09_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ...able_endpoint_services_operations_async.py | 12 +- ...gp_service_communities_operations_async.py | 12 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...oute_service_providers_operations_async.py | 12 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 116 +- .../aio/operations_async/_operations_async.py | 12 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 126 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 60 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- ..._available_endpoint_services_operations.py | 12 +- .../_bgp_service_communities_operations.py | 12 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- ...ress_route_service_providers_operations.py | 12 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 72 +- .../v2017_09_01/operations/_operations.py | 12 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 86 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 48 +- .../mgmt/network/v2017_10_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ...able_endpoint_services_operations_async.py | 12 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...oute_service_providers_operations_async.py | 12 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 116 +- .../aio/operations_async/_operations_async.py | 12 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 126 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 60 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- ..._available_endpoint_services_operations.py | 12 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- ...ress_route_service_providers_operations.py | 12 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 72 +- .../v2017_10_01/operations/_operations.py | 12 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 86 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 48 +- .../mgmt/network/v2017_11_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ...able_endpoint_services_operations_async.py | 12 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...oute_service_providers_operations_async.py | 12 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 116 +- .../aio/operations_async/_operations_async.py | 12 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 126 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 60 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- ..._available_endpoint_services_operations.py | 12 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- ...ress_route_service_providers_operations.py | 12 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 72 +- .../v2017_11_01/operations/_operations.py | 12 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 86 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 48 +- .../mgmt/network/v2018_01_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ...able_endpoint_services_operations_async.py | 12 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...oute_service_providers_operations_async.py | 12 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 116 +- .../aio/operations_async/_operations_async.py | 12 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 126 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 60 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- ..._available_endpoint_services_operations.py | 12 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- ...ress_route_service_providers_operations.py | 12 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 72 +- .../v2018_01_01/operations/_operations.py | 12 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 86 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 48 +- .../mgmt/network/v2018_02_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ...able_endpoint_services_operations_async.py | 12 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- ..._ddos_protection_plans_operations_async.py | 40 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 16 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...oute_service_providers_operations_async.py | 12 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 116 +- .../aio/operations_async/_operations_async.py | 12 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 144 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 60 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- ..._available_endpoint_services_operations.py | 12 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_protection_plans_operations.py | 32 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 8 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- ...ress_route_service_providers_operations.py | 12 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 72 +- .../v2018_02_01/operations/_operations.py | 12 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 96 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 48 +- .../mgmt/network/v2018_04_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ...able_endpoint_services_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- ..._ddos_protection_plans_operations_async.py | 40 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 16 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...oute_service_providers_operations_async.py | 12 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 116 +- .../aio/operations_async/_operations_async.py | 12 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 144 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 48 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- ..._available_endpoint_services_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_protection_plans_operations.py | 32 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 8 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- ...ress_route_service_providers_operations.py | 12 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 72 +- .../v2018_04_01/operations/_operations.py | 12 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 96 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 36 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- .../mgmt/network/v2018_06_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ...able_endpoint_services_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- ..._ddos_protection_plans_operations_async.py | 40 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 16 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...oute_service_providers_operations_async.py | 12 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 151 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 48 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- ..._available_endpoint_services_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_protection_plans_operations.py | 32 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 8 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- ...ress_route_service_providers_operations.py | 12 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2018_06_01/operations/_operations.py | 12 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 99 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 36 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- .../mgmt/network/v2018_07_01/_metadata.json | 6 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ...able_endpoint_services_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- ..._ddos_protection_plans_operations_async.py | 40 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 16 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...oute_service_providers_operations_async.py | 12 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 1 - ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 144 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 48 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- ..._available_endpoint_services_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_protection_plans_operations.py | 32 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 8 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- ...ress_route_service_providers_operations.py | 12 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 1 - .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2018_07_01/operations/_operations.py | 12 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 96 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 36 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- .../mgmt/network/v2018_08_01/_metadata.json | 8 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...urce_group_delegations_operations_async.py | 12 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- ..._ddos_protection_plans_operations_async.py | 40 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 16 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 47 +- ...oute_service_providers_operations_async.py | 12 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_interface_endpoints_operations_async.py | 40 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 2 - .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 59 +- ..._server_configurations_operations_async.py | 28 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 151 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 47 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 48 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...e_resource_group_delegations_operations.py | 12 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_protection_plans_operations.py | 32 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 8 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 35 +- ...ress_route_service_providers_operations.py | 12 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../_interface_endpoints_operations.py | 32 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 2 - .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2018_08_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 43 +- ...2_svpn_server_configurations_operations.py | 20 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 99 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 35 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 36 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- .../mgmt/network/v2018_10_01/_metadata.json | 8 +- .../_application_gateways_operations_async.py | 87 +- ...cation_security_groups_operations_async.py | 40 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...urce_group_delegations_operations_async.py | 12 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- ..._ddos_protection_plans_operations_async.py | 40 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 47 +- ...oute_service_providers_operations_async.py | 12 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_interface_endpoints_operations_async.py | 40 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 2 - .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 59 +- ..._server_configurations_operations_async.py | 28 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 151 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 47 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 48 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- .../_application_gateways_operations.py | 63 +- ..._application_security_groups_operations.py | 32 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...e_resource_group_delegations_operations.py | 12 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_protection_plans_operations.py | 32 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 35 +- ...ress_route_service_providers_operations.py | 12 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../_interface_endpoints_operations.py | 32 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 2 - .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2018_10_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 43 +- ...2_svpn_server_configurations_operations.py | 20 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 99 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 35 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 36 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- .../mgmt/network/v2018_11_01/_metadata.json | 8 +- .../_application_gateways_operations_async.py | 90 +- ...cation_security_groups_operations_async.py | 47 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...urce_group_delegations_operations_async.py | 12 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- .../_ddos_custom_policies_operations_async.py | 23 +- ..._ddos_protection_plans_operations_async.py | 47 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 47 +- ...oute_service_providers_operations_async.py | 12 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_interface_endpoints_operations_async.py | 40 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 2 - .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 59 +- ..._server_configurations_operations_async.py | 28 +- .../_packet_captures_operations_async.py | 42 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_subnets_operations_async.py | 28 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 151 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 47 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 48 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- .../_application_gateways_operations.py | 66 +- ..._application_security_groups_operations.py | 35 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...e_resource_group_delegations_operations.py | 12 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_custom_policies_operations.py | 11 +- .../_ddos_protection_plans_operations.py | 35 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 35 +- ...ress_route_service_providers_operations.py | 12 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../_interface_endpoints_operations.py | 32 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 2 - .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2018_11_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 43 +- ...2_svpn_server_configurations_operations.py | 20 +- .../operations/_packet_captures_operations.py | 26 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_subnets_operations.py | 20 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 99 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 35 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 36 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- .../mgmt/network/v2018_12_01/_metadata.json | 8 +- .../_application_gateways_operations_async.py | 90 +- ...cation_security_groups_operations_async.py | 47 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...urce_group_delegations_operations_async.py | 12 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- .../_ddos_custom_policies_operations_async.py | 23 +- ..._ddos_protection_plans_operations_async.py | 47 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 47 +- ...oute_service_providers_operations_async.py | 12 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_interface_endpoints_operations_async.py | 40 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 2 - .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 59 +- ..._server_configurations_operations_async.py | 28 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_subnets_operations_async.py | 35 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 151 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 47 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 48 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- ...tion_firewall_policies_operations_async.py | 34 +- .../_application_gateways_operations.py | 66 +- ..._application_security_groups_operations.py | 35 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...e_resource_group_delegations_operations.py | 12 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_custom_policies_operations.py | 11 +- .../_ddos_protection_plans_operations.py | 35 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 35 +- ...ress_route_service_providers_operations.py | 12 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../_interface_endpoints_operations.py | 32 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 2 - .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2018_12_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 43 +- ...2_svpn_server_configurations_operations.py | 20 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_subnets_operations.py | 23 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 99 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 35 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 36 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2019_02_01/_metadata.json | 8 +- .../_application_gateways_operations_async.py | 101 +- ...cation_security_groups_operations_async.py | 47 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...urce_group_delegations_operations_async.py | 12 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- .../_ddos_custom_policies_operations_async.py | 23 +- ..._ddos_protection_plans_operations_async.py | 47 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 47 +- ...oute_service_providers_operations_async.py | 12 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_interface_endpoints_operations_async.py | 40 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 2 - .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 59 +- ..._server_configurations_operations_async.py | 28 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_subnets_operations_async.py | 35 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 151 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 47 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 48 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- ...tion_firewall_policies_operations_async.py | 34 +- .../_application_gateways_operations.py | 73 +- ..._application_security_groups_operations.py | 35 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...e_resource_group_delegations_operations.py | 12 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_custom_policies_operations.py | 11 +- .../_ddos_protection_plans_operations.py | 35 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 35 +- ...ress_route_service_providers_operations.py | 12 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../_interface_endpoints_operations.py | 32 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 2 - .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2019_02_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 43 +- ...2_svpn_server_configurations_operations.py | 20 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_subnets_operations.py | 23 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 99 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 35 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 36 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2019_04_01/_metadata.json | 8 +- .../_application_gateways_operations_async.py | 101 +- ...cation_security_groups_operations_async.py | 47 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...private_endpoint_types_operations_async.py | 24 +- ...urce_group_delegations_operations_async.py | 12 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 40 +- .../_bastion_hosts_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 50 +- .../_ddos_custom_policies_operations_async.py | 23 +- ..._ddos_protection_plans_operations_async.py | 47 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 47 +- ...oute_service_providers_operations_async.py | 12 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 2 - .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 70 +- ..._server_configurations_operations_async.py | 28 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- .../_private_endpoints_operations_async.py | 40 +- ..._private_link_services_operations_async.py | 240 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_service_tags_operations_async.py | 1 - .../_subnets_operations_async.py | 35 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 55 +- ...rtual_network_gateways_operations_async.py | 162 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 47 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 59 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- ...tion_firewall_policies_operations_async.py | 34 +- .../_application_gateways_operations.py | 73 +- ..._application_security_groups_operations.py | 35 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...lable_private_endpoint_types_operations.py | 24 +- ...e_resource_group_delegations_operations.py | 12 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 32 +- .../operations/_bastion_hosts_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 30 +- .../_ddos_custom_policies_operations.py | 11 +- .../_ddos_protection_plans_operations.py | 35 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 35 +- ...ress_route_service_providers_operations.py | 12 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 2 - .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2019_04_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 50 +- ...2_svpn_server_configurations_operations.py | 20 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_private_endpoints_operations.py | 32 +- .../_private_link_services_operations.py | 230 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_service_tags_operations.py | 1 - .../operations/_subnets_operations.py | 23 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 35 +- .../_virtual_network_gateways_operations.py | 106 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 35 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 43 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2019_06_01/_metadata.json | 8 +- .../_application_gateways_operations_async.py | 101 +- ...cation_security_groups_operations_async.py | 47 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...private_endpoint_types_operations_async.py | 24 +- ...urce_group_delegations_operations_async.py | 12 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 41 +- .../_bastion_hosts_operations_async.py | 48 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 51 +- .../_ddos_custom_policies_operations_async.py | 23 +- ..._ddos_protection_plans_operations_async.py | 47 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 47 +- ...oute_service_providers_operations_async.py | 12 +- .../_firewall_policies_operations_async.py | 41 +- ...all_policy_rule_groups_operations_async.py | 28 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 2 - .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 70 +- ..._server_configurations_operations_async.py | 28 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- .../_private_endpoints_operations_async.py | 40 +- ..._private_link_services_operations_async.py | 240 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_service_tags_operations_async.py | 1 - .../_subnets_operations_async.py | 42 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 59 +- ...rtual_network_gateways_operations_async.py | 166 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 47 +- .../_virtual_networks_operations_async.py | 60 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 59 +- .../_vpn_link_connections_operations_async.py | 12 +- ..._site_link_connections_operations_async.py | 1 - .../_vpn_site_links_operations_async.py | 13 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- ...tion_firewall_policies_operations_async.py | 34 +- .../_application_gateways_operations.py | 73 +- ..._application_security_groups_operations.py | 35 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...lable_private_endpoint_types_operations.py | 24 +- ...e_resource_group_delegations_operations.py | 12 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 33 +- .../operations/_bastion_hosts_operations.py | 36 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 31 +- .../_ddos_custom_policies_operations.py | 11 +- .../_ddos_protection_plans_operations.py | 35 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 35 +- ...ress_route_service_providers_operations.py | 12 +- .../_firewall_policies_operations.py | 33 +- ..._firewall_policy_rule_groups_operations.py | 20 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 2 - .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2019_06_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 50 +- ...2_svpn_server_configurations_operations.py | 20 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_private_endpoints_operations.py | 32 +- .../_private_link_services_operations.py | 230 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_service_tags_operations.py | 1 - .../operations/_subnets_operations.py | 26 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 39 +- .../_virtual_network_gateways_operations.py | 110 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 35 +- .../_virtual_networks_operations.py | 48 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 43 +- .../_vpn_link_connections_operations.py | 12 +- .../_vpn_site_link_connections_operations.py | 1 - .../operations/_vpn_site_links_operations.py | 13 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2019_07_01/_metadata.json | 8 +- .../_application_gateways_operations_async.py | 101 +- ...cation_security_groups_operations_async.py | 47 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...private_endpoint_types_operations_async.py | 24 +- ...urce_group_delegations_operations_async.py | 12 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 41 +- .../_bastion_hosts_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 51 +- .../_ddos_custom_policies_operations_async.py | 23 +- ..._ddos_protection_plans_operations_async.py | 47 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 47 +- ...oute_service_providers_operations_async.py | 12 +- .../_firewall_policies_operations_async.py | 41 +- ...all_policy_rule_groups_operations_async.py | 28 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 2 - .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 70 +- ..._server_configurations_operations_async.py | 28 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- .../_private_endpoints_operations_async.py | 40 +- ..._private_link_services_operations_async.py | 244 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_service_tags_operations_async.py | 1 - .../_subnets_operations_async.py | 42 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 81 +- ...rtual_network_gateways_operations_async.py | 188 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 47 +- .../_virtual_networks_operations_async.py | 60 +- ...irtual_router_peerings_operations_async.py | 29 +- .../_virtual_routers_operations_async.py | 41 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 59 +- .../_vpn_link_connections_operations_async.py | 12 +- ..._site_link_connections_operations_async.py | 1 - .../_vpn_site_links_operations_async.py | 13 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- ...tion_firewall_policies_operations_async.py | 34 +- .../_application_gateways_operations.py | 73 +- ..._application_security_groups_operations.py | 35 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...lable_private_endpoint_types_operations.py | 24 +- ...e_resource_group_delegations_operations.py | 12 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 33 +- .../operations/_bastion_hosts_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 31 +- .../_ddos_custom_policies_operations.py | 11 +- .../_ddos_protection_plans_operations.py | 35 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 35 +- ...ress_route_service_providers_operations.py | 12 +- .../_firewall_policies_operations.py | 33 +- ..._firewall_policy_rule_groups_operations.py | 20 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 2 - .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2019_07_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 50 +- ...2_svpn_server_configurations_operations.py | 20 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_private_endpoints_operations.py | 32 +- .../_private_link_services_operations.py | 234 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_service_tags_operations.py | 1 - .../operations/_subnets_operations.py | 26 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 53 +- .../_virtual_network_gateways_operations.py | 124 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 35 +- .../_virtual_networks_operations.py | 48 +- .../_virtual_router_peerings_operations.py | 21 +- .../operations/_virtual_routers_operations.py | 33 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 43 +- .../_vpn_link_connections_operations.py | 12 +- .../_vpn_site_link_connections_operations.py | 1 - .../operations/_vpn_site_links_operations.py | 13 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2019_08_01/_metadata.json | 20 +- .../_application_gateways_operations_async.py | 101 +- ...cation_security_groups_operations_async.py | 47 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...private_endpoint_types_operations_async.py | 24 +- ...urce_group_delegations_operations_async.py | 12 +- ...ilable_service_aliases_operations_async.py | 24 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 41 +- .../_bastion_hosts_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 51 +- .../_ddos_custom_policies_operations_async.py | 23 +- ..._ddos_protection_plans_operations_async.py | 47 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 82 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 72 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 47 +- ...oute_service_providers_operations_async.py | 12 +- .../_firewall_policies_operations_async.py | 41 +- ...all_policy_rule_groups_operations_async.py | 28 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 47 +- ...local_network_gateways_operations_async.py | 35 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 107 +- ...work_management_client_operations_async.py | 13 +- .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 47 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 81 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- .../_private_endpoints_operations_async.py | 40 +- ..._private_link_services_operations_async.py | 244 +- .../_public_ip_addresses_operations_async.py | 72 +- .../_public_ip_prefixes_operations_async.py | 47 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 35 +- .../_route_filters_operations_async.py | 47 +- .../_route_tables_operations_async.py | 47 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 47 +- ...int_policy_definitions_operations_async.py | 28 +- .../_service_tags_operations_async.py | 1 - .../_subnets_operations_async.py | 42 +- .../_usages_operations_async.py | 12 +- .../_virtual_hubs_operations_async.py | 48 +- ...rk_gateway_connections_operations_async.py | 81 +- ...rtual_network_gateways_operations_async.py | 188 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 47 +- .../_virtual_networks_operations_async.py | 60 +- ...irtual_router_peerings_operations_async.py | 29 +- .../_virtual_routers_operations_async.py | 41 +- .../_virtual_wans_operations_async.py | 48 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 59 +- .../_vpn_link_connections_operations_async.py | 12 +- ...iated_with_virtual_wan_operations_async.py | 11 +- ..._server_configurations_operations_async.py | 48 +- ..._site_link_connections_operations_async.py | 1 - .../_vpn_site_links_operations_async.py | 13 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 48 +- ...tion_firewall_policies_operations_async.py | 34 +- .../_application_gateways_operations.py | 73 +- ..._application_security_groups_operations.py | 35 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...lable_private_endpoint_types_operations.py | 24 +- ...e_resource_group_delegations_operations.py | 12 +- .../_available_service_aliases_operations.py | 24 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 33 +- .../operations/_bastion_hosts_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 31 +- .../_ddos_custom_policies_operations.py | 11 +- .../_ddos_protection_plans_operations.py | 35 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 58 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 52 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 35 +- ...ress_route_service_providers_operations.py | 12 +- .../_firewall_policies_operations.py | 33 +- ..._firewall_policy_rule_groups_operations.py | 20 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 35 +- .../_local_network_gateways_operations.py | 23 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 87 +- .../_network_management_client_operations.py | 9 +- .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 35 +- .../_network_watchers_operations.py | 76 +- .../v2019_08_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 57 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_private_endpoints_operations.py | 32 +- .../_private_link_services_operations.py | 234 +- .../_public_ip_addresses_operations.py | 60 +- .../_public_ip_prefixes_operations.py | 35 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 23 +- .../operations/_route_filters_operations.py | 35 +- .../operations/_route_tables_operations.py | 35 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 35 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_service_tags_operations.py | 1 - .../operations/_subnets_operations.py | 26 +- .../operations/_usages_operations.py | 12 +- .../operations/_virtual_hubs_operations.py | 36 +- ..._network_gateway_connections_operations.py | 53 +- .../_virtual_network_gateways_operations.py | 124 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 35 +- .../_virtual_networks_operations.py | 48 +- .../_virtual_router_peerings_operations.py | 21 +- .../operations/_virtual_routers_operations.py | 33 +- .../operations/_virtual_wans_operations.py | 36 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 43 +- .../_vpn_link_connections_operations.py | 12 +- ..._associated_with_virtual_wan_operations.py | 7 +- .../_vpn_server_configurations_operations.py | 36 +- .../_vpn_site_link_connections_operations.py | 1 - .../operations/_vpn_site_links_operations.py | 13 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 36 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2019_09_01/_metadata.json | 56 +- .../_application_gateways_operations_async.py | 95 +- ...cation_security_groups_operations_async.py | 41 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...private_endpoint_types_operations_async.py | 24 +- ...urce_group_delegations_operations_async.py | 12 +- ...ilable_service_aliases_operations_async.py | 24 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 51 +- .../_bastion_hosts_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 51 +- .../_ddos_custom_policies_operations_async.py | 17 +- ..._ddos_protection_plans_operations_async.py | 41 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 76 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 66 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 41 +- ...oute_service_providers_operations_async.py | 12 +- .../_firewall_policies_operations_async.py | 40 +- ...all_policy_rule_groups_operations_async.py | 28 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_ip_groups_operations_async.py | 41 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 41 +- ...local_network_gateways_operations_async.py | 29 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 101 +- ...work_management_client_operations_async.py | 90 +- .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 41 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 74 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- .../_private_endpoints_operations_async.py | 40 +- ..._private_link_services_operations_async.py | 257 +- .../_public_ip_addresses_operations_async.py | 66 +- .../_public_ip_prefixes_operations_async.py | 41 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 28 +- .../_route_filters_operations_async.py | 41 +- .../_route_tables_operations_async.py | 41 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 41 +- ...int_policy_definitions_operations_async.py | 28 +- .../_service_tags_operations_async.py | 1 - .../_subnets_operations_async.py | 42 +- .../_usages_operations_async.py | 12 +- ...l_hub_route_table_v2_s_operations_async.py | 28 +- .../_virtual_hubs_operations_async.py | 41 +- ...rk_gateway_connections_operations_async.py | 81 +- ...rtual_network_gateways_operations_async.py | 188 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 41 +- .../_virtual_networks_operations_async.py | 54 +- ...irtual_router_peerings_operations_async.py | 28 +- .../_virtual_routers_operations_async.py | 40 +- .../_virtual_wans_operations_async.py | 41 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 52 +- .../_vpn_link_connections_operations_async.py | 12 +- ...iated_with_virtual_wan_operations_async.py | 11 +- ..._server_configurations_operations_async.py | 41 +- ..._site_link_connections_operations_async.py | 1 - .../_vpn_site_links_operations_async.py | 13 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 41 +- ...tion_firewall_policies_operations_async.py | 34 +- .../_application_gateways_operations.py | 71 +- ..._application_security_groups_operations.py | 33 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...lable_private_endpoint_types_operations.py | 24 +- ...e_resource_group_delegations_operations.py | 12 +- .../_available_service_aliases_operations.py | 24 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 39 +- .../operations/_bastion_hosts_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 31 +- .../_ddos_custom_policies_operations.py | 9 +- .../_ddos_protection_plans_operations.py | 33 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 56 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 50 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 33 +- ...ress_route_service_providers_operations.py | 12 +- .../_firewall_policies_operations.py | 32 +- ..._firewall_policy_rule_groups_operations.py | 20 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../operations/_ip_groups_operations.py | 33 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 33 +- .../_local_network_gateways_operations.py | 21 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 85 +- .../_network_management_client_operations.py | 74 +- .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 33 +- .../_network_watchers_operations.py | 76 +- .../v2019_09_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 54 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_private_endpoints_operations.py | 32 +- .../_private_link_services_operations.py | 247 +- .../_public_ip_addresses_operations.py | 58 +- .../_public_ip_prefixes_operations.py | 33 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 20 +- .../operations/_route_filters_operations.py | 33 +- .../operations/_route_tables_operations.py | 33 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 33 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_service_tags_operations.py | 1 - .../operations/_subnets_operations.py | 26 +- .../operations/_usages_operations.py | 12 +- ...virtual_hub_route_table_v2_s_operations.py | 20 +- .../operations/_virtual_hubs_operations.py | 33 +- ..._network_gateway_connections_operations.py | 53 +- .../_virtual_network_gateways_operations.py | 124 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 33 +- .../_virtual_networks_operations.py | 46 +- .../_virtual_router_peerings_operations.py | 20 +- .../operations/_virtual_routers_operations.py | 32 +- .../operations/_virtual_wans_operations.py | 33 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 40 +- .../_vpn_link_connections_operations.py | 12 +- ..._associated_with_virtual_wan_operations.py | 7 +- .../_vpn_server_configurations_operations.py | 33 +- .../_vpn_site_link_connections_operations.py | 1 - .../operations/_vpn_site_links_operations.py | 13 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 33 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2019_11_01/_metadata.json | 56 +- .../_application_gateways_operations_async.py | 95 +- ...cation_security_groups_operations_async.py | 41 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...private_endpoint_types_operations_async.py | 24 +- ...urce_group_delegations_operations_async.py | 12 +- ...ilable_service_aliases_operations_async.py | 24 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 41 +- .../_bastion_hosts_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 51 +- .../_ddos_custom_policies_operations_async.py | 17 +- ..._ddos_protection_plans_operations_async.py | 41 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 76 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 66 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 41 +- ...oute_service_providers_operations_async.py | 12 +- .../_firewall_policies_operations_async.py | 40 +- ...all_policy_rule_groups_operations_async.py | 28 +- .../_flow_logs_operations_async.py | 28 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_ip_groups_operations_async.py | 41 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 41 +- ...local_network_gateways_operations_async.py | 29 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 101 +- ...work_management_client_operations_async.py | 90 +- .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 41 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 81 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- .../_private_endpoints_operations_async.py | 40 +- ..._private_link_services_operations_async.py | 257 +- .../_public_ip_addresses_operations_async.py | 66 +- .../_public_ip_prefixes_operations_async.py | 41 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 28 +- .../_route_filters_operations_async.py | 41 +- .../_route_tables_operations_async.py | 41 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 41 +- ...int_policy_definitions_operations_async.py | 28 +- .../_service_tags_operations_async.py | 1 - .../_subnets_operations_async.py | 42 +- .../_usages_operations_async.py | 12 +- ...l_hub_route_table_v2_s_operations_async.py | 28 +- .../_virtual_hubs_operations_async.py | 41 +- ...rk_gateway_connections_operations_async.py | 81 +- ...rtual_network_gateways_operations_async.py | 195 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 41 +- .../_virtual_networks_operations_async.py | 54 +- ...irtual_router_peerings_operations_async.py | 28 +- .../_virtual_routers_operations_async.py | 40 +- .../_virtual_wans_operations_async.py | 41 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 52 +- .../_vpn_link_connections_operations_async.py | 12 +- ...iated_with_virtual_wan_operations_async.py | 11 +- ..._server_configurations_operations_async.py | 41 +- ..._site_link_connections_operations_async.py | 1 - .../_vpn_site_links_operations_async.py | 13 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 41 +- ...tion_firewall_policies_operations_async.py | 34 +- .../_application_gateways_operations.py | 71 +- ..._application_security_groups_operations.py | 33 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...lable_private_endpoint_types_operations.py | 24 +- ...e_resource_group_delegations_operations.py | 12 +- .../_available_service_aliases_operations.py | 24 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 33 +- .../operations/_bastion_hosts_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 31 +- .../_ddos_custom_policies_operations.py | 9 +- .../_ddos_protection_plans_operations.py | 33 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 56 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 50 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 33 +- ...ress_route_service_providers_operations.py | 12 +- .../_firewall_policies_operations.py | 32 +- ..._firewall_policy_rule_groups_operations.py | 20 +- .../operations/_flow_logs_operations.py | 20 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../operations/_ip_groups_operations.py | 33 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 33 +- .../_local_network_gateways_operations.py | 21 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 85 +- .../_network_management_client_operations.py | 74 +- .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 33 +- .../_network_watchers_operations.py | 76 +- .../v2019_11_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 57 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_private_endpoints_operations.py | 32 +- .../_private_link_services_operations.py | 247 +- .../_public_ip_addresses_operations.py | 58 +- .../_public_ip_prefixes_operations.py | 33 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 20 +- .../operations/_route_filters_operations.py | 33 +- .../operations/_route_tables_operations.py | 33 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 33 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_service_tags_operations.py | 1 - .../operations/_subnets_operations.py | 26 +- .../operations/_usages_operations.py | 12 +- ...virtual_hub_route_table_v2_s_operations.py | 20 +- .../operations/_virtual_hubs_operations.py | 33 +- ..._network_gateway_connections_operations.py | 53 +- .../_virtual_network_gateways_operations.py | 127 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 33 +- .../_virtual_networks_operations.py | 46 +- .../_virtual_router_peerings_operations.py | 20 +- .../operations/_virtual_routers_operations.py | 32 +- .../operations/_virtual_wans_operations.py | 33 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 40 +- .../_vpn_link_connections_operations.py | 12 +- ..._associated_with_virtual_wan_operations.py | 7 +- .../_vpn_server_configurations_operations.py | 33 +- .../_vpn_site_link_connections_operations.py | 1 - .../operations/_vpn_site_links_operations.py | 13 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 33 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2019_12_01/_metadata.json | 56 +- .../_application_gateways_operations_async.py | 95 +- ...cation_security_groups_operations_async.py | 41 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...private_endpoint_types_operations_async.py | 24 +- ...urce_group_delegations_operations_async.py | 12 +- ...ilable_service_aliases_operations_async.py | 24 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 41 +- .../_bastion_hosts_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 51 +- .../_ddos_custom_policies_operations_async.py | 17 +- ..._ddos_protection_plans_operations_async.py | 41 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 76 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 66 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 41 +- ...oute_service_providers_operations_async.py | 12 +- .../_firewall_policies_operations_async.py | 40 +- ...all_policy_rule_groups_operations_async.py | 28 +- .../_flow_logs_operations_async.py | 28 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_ip_groups_operations_async.py | 41 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 41 +- ...local_network_gateways_operations_async.py | 29 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 101 +- ...work_management_client_operations_async.py | 90 +- .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 41 +- ...ork_virtual_appliances_operations_async.py | 41 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 81 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- .../_private_endpoints_operations_async.py | 40 +- ..._private_link_services_operations_async.py | 257 +- .../_public_ip_addresses_operations_async.py | 66 +- .../_public_ip_prefixes_operations_async.py | 41 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 28 +- .../_route_filters_operations_async.py | 41 +- .../_route_tables_operations_async.py | 41 +- .../_routes_operations_async.py | 28 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 41 +- ...int_policy_definitions_operations_async.py | 28 +- .../_service_tags_operations_async.py | 1 - .../_subnets_operations_async.py | 42 +- .../_usages_operations_async.py | 12 +- ...l_hub_route_table_v2_s_operations_async.py | 28 +- .../_virtual_hubs_operations_async.py | 41 +- ...rk_gateway_connections_operations_async.py | 81 +- ...rtual_network_gateways_operations_async.py | 195 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 41 +- .../_virtual_networks_operations_async.py | 54 +- ...irtual_router_peerings_operations_async.py | 28 +- .../_virtual_routers_operations_async.py | 40 +- .../_virtual_wans_operations_async.py | 41 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 52 +- .../_vpn_link_connections_operations_async.py | 12 +- ...iated_with_virtual_wan_operations_async.py | 11 +- ..._server_configurations_operations_async.py | 41 +- ..._site_link_connections_operations_async.py | 1 - .../_vpn_site_links_operations_async.py | 13 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 41 +- ...tion_firewall_policies_operations_async.py | 34 +- .../_application_gateways_operations.py | 71 +- ..._application_security_groups_operations.py | 33 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...lable_private_endpoint_types_operations.py | 24 +- ...e_resource_group_delegations_operations.py | 12 +- .../_available_service_aliases_operations.py | 24 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 33 +- .../operations/_bastion_hosts_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 31 +- .../_ddos_custom_policies_operations.py | 9 +- .../_ddos_protection_plans_operations.py | 33 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 56 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 50 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 33 +- ...ress_route_service_providers_operations.py | 12 +- .../_firewall_policies_operations.py | 32 +- ..._firewall_policy_rule_groups_operations.py | 20 +- .../operations/_flow_logs_operations.py | 20 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../operations/_ip_groups_operations.py | 33 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 33 +- .../_local_network_gateways_operations.py | 21 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 85 +- .../_network_management_client_operations.py | 74 +- .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 33 +- .../_network_virtual_appliances_operations.py | 33 +- .../_network_watchers_operations.py | 76 +- .../v2019_12_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 57 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_private_endpoints_operations.py | 32 +- .../_private_link_services_operations.py | 247 +- .../_public_ip_addresses_operations.py | 58 +- .../_public_ip_prefixes_operations.py | 33 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 20 +- .../operations/_route_filters_operations.py | 33 +- .../operations/_route_tables_operations.py | 33 +- .../operations/_routes_operations.py | 20 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 33 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_service_tags_operations.py | 1 - .../operations/_subnets_operations.py | 26 +- .../operations/_usages_operations.py | 12 +- ...virtual_hub_route_table_v2_s_operations.py | 20 +- .../operations/_virtual_hubs_operations.py | 33 +- ..._network_gateway_connections_operations.py | 53 +- .../_virtual_network_gateways_operations.py | 127 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 33 +- .../_virtual_networks_operations.py | 46 +- .../_virtual_router_peerings_operations.py | 20 +- .../operations/_virtual_routers_operations.py | 32 +- .../operations/_virtual_wans_operations.py | 33 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 40 +- .../_vpn_link_connections_operations.py | 12 +- ..._associated_with_virtual_wan_operations.py | 7 +- .../_vpn_server_configurations_operations.py | 33 +- .../_vpn_site_link_connections_operations.py | 1 - .../operations/_vpn_site_links_operations.py | 13 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 33 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2020_03_01/_metadata.json | 56 +- .../_application_gateways_operations_async.py | 95 +- ...cation_security_groups_operations_async.py | 41 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...private_endpoint_types_operations_async.py | 24 +- ...urce_group_delegations_operations_async.py | 12 +- ...ilable_service_aliases_operations_async.py | 24 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 51 +- .../_bastion_hosts_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 51 +- .../_ddos_custom_policies_operations_async.py | 17 +- ..._ddos_protection_plans_operations_async.py | 41 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 76 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 66 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 41 +- ...oute_service_providers_operations_async.py | 12 +- .../_firewall_policies_operations_async.py | 40 +- ...all_policy_rule_groups_operations_async.py | 28 +- .../_flow_logs_operations_async.py | 28 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_ip_allocations_operations_async.py | 41 +- .../_ip_groups_operations_async.py | 41 +- ..._backend_address_pools_operations_async.py | 13 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 41 +- ...local_network_gateways_operations_async.py | 29 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 101 +- ...work_management_client_operations_async.py | 90 +- .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 41 +- ...ork_virtual_appliances_operations_async.py | 41 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 81 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- ...rivate_dns_zone_groups_operations_async.py | 28 +- .../_private_endpoints_operations_async.py | 40 +- ..._private_link_services_operations_async.py | 257 +- .../_public_ip_addresses_operations_async.py | 66 +- .../_public_ip_prefixes_operations_async.py | 41 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 28 +- .../_route_filters_operations_async.py | 41 +- .../_route_tables_operations_async.py | 41 +- .../_routes_operations_async.py | 28 +- ...rity_partner_providers_operations_async.py | 41 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 41 +- ...int_policy_definitions_operations_async.py | 28 +- .../_service_tags_operations_async.py | 1 - .../_subnets_operations_async.py | 42 +- .../_usages_operations_async.py | 12 +- ...l_hub_route_table_v2_s_operations_async.py | 28 +- .../_virtual_hubs_operations_async.py | 41 +- ...rk_gateway_connections_operations_async.py | 81 +- ...rtual_network_gateways_operations_async.py | 195 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 41 +- .../_virtual_networks_operations_async.py | 54 +- ...irtual_router_peerings_operations_async.py | 28 +- .../_virtual_routers_operations_async.py | 40 +- .../_virtual_wans_operations_async.py | 41 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 52 +- .../_vpn_link_connections_operations_async.py | 12 +- ...iated_with_virtual_wan_operations_async.py | 11 +- ..._server_configurations_operations_async.py | 41 +- ..._site_link_connections_operations_async.py | 1 - .../_vpn_site_links_operations_async.py | 13 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 41 +- ...tion_firewall_policies_operations_async.py | 34 +- .../network/v2020_03_01/models/__init__.py | 2 - .../network/v2020_03_01/models/_models.py | 6 - .../network/v2020_03_01/models/_models_py3.py | 7 - .../_network_management_client_enums.py | 7 - .../_application_gateways_operations.py | 71 +- ..._application_security_groups_operations.py | 33 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...lable_private_endpoint_types_operations.py | 24 +- ...e_resource_group_delegations_operations.py | 12 +- .../_available_service_aliases_operations.py | 24 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 39 +- .../operations/_bastion_hosts_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 31 +- .../_ddos_custom_policies_operations.py | 9 +- .../_ddos_protection_plans_operations.py | 33 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 56 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 50 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 33 +- ...ress_route_service_providers_operations.py | 12 +- .../_firewall_policies_operations.py | 32 +- ..._firewall_policy_rule_groups_operations.py | 20 +- .../operations/_flow_logs_operations.py | 20 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../operations/_ip_allocations_operations.py | 33 +- .../operations/_ip_groups_operations.py | 33 +- ...lancer_backend_address_pools_operations.py | 13 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 33 +- .../_local_network_gateways_operations.py | 21 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 85 +- .../_network_management_client_operations.py | 74 +- .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 33 +- .../_network_virtual_appliances_operations.py | 33 +- .../_network_watchers_operations.py | 76 +- .../v2020_03_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 57 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_private_dns_zone_groups_operations.py | 20 +- .../_private_endpoints_operations.py | 32 +- .../_private_link_services_operations.py | 247 +- .../_public_ip_addresses_operations.py | 58 +- .../_public_ip_prefixes_operations.py | 33 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 20 +- .../operations/_route_filters_operations.py | 33 +- .../operations/_route_tables_operations.py | 33 +- .../operations/_routes_operations.py | 20 +- .../_security_partner_providers_operations.py | 33 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 33 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_service_tags_operations.py | 1 - .../operations/_subnets_operations.py | 26 +- .../operations/_usages_operations.py | 12 +- ...virtual_hub_route_table_v2_s_operations.py | 20 +- .../operations/_virtual_hubs_operations.py | 33 +- ..._network_gateway_connections_operations.py | 53 +- .../_virtual_network_gateways_operations.py | 127 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 33 +- .../_virtual_networks_operations.py | 46 +- .../_virtual_router_peerings_operations.py | 20 +- .../operations/_virtual_routers_operations.py | 32 +- .../operations/_virtual_wans_operations.py | 33 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 40 +- .../_vpn_link_connections_operations.py | 12 +- ..._associated_with_virtual_wan_operations.py | 7 +- .../_vpn_server_configurations_operations.py | 33 +- .../_vpn_site_link_connections_operations.py | 1 - .../operations/_vpn_site_links_operations.py | 13 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 33 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2020_04_01/_metadata.json | 56 +- .../_application_gateways_operations_async.py | 95 +- ...cation_security_groups_operations_async.py | 41 +- ..._available_delegations_operations_async.py | 12 +- ...able_endpoint_services_operations_async.py | 12 +- ...private_endpoint_types_operations_async.py | 24 +- ...urce_group_delegations_operations_async.py | 12 +- ...ilable_service_aliases_operations_async.py | 24 +- ...ure_firewall_fqdn_tags_operations_async.py | 12 +- .../_azure_firewalls_operations_async.py | 51 +- .../_bastion_hosts_operations_async.py | 40 +- ...gp_service_communities_operations_async.py | 12 +- .../_connection_monitors_operations_async.py | 51 +- .../_ddos_custom_policies_operations_async.py | 17 +- ..._ddos_protection_plans_operations_async.py | 41 +- ...default_security_rules_operations_async.py | 13 +- ...circuit_authorizations_operations_async.py | 28 +- ...te_circuit_connections_operations_async.py | 28 +- ...route_circuit_peerings_operations_async.py | 28 +- ...express_route_circuits_operations_async.py | 76 +- ...ress_route_connections_operations_async.py | 17 +- ...ss_connection_peerings_operations_async.py | 28 +- ...oute_cross_connections_operations_async.py | 66 +- ...express_route_gateways_operations_async.py | 18 +- .../_express_route_links_operations_async.py | 13 +- ..._route_ports_locations_operations_async.py | 13 +- .../_express_route_ports_operations_async.py | 41 +- ...oute_service_providers_operations_async.py | 12 +- .../_firewall_policies_operations_async.py | 40 +- ...all_policy_rule_groups_operations_async.py | 28 +- .../_flow_logs_operations_async.py | 28 +- .../_hub_route_tables_operations_async.py | 28 +- ...al_network_connections_operations_async.py | 13 +- .../_inbound_nat_rules_operations_async.py | 28 +- .../_ip_allocations_operations_async.py | 41 +- .../_ip_groups_operations_async.py | 41 +- ..._backend_address_pools_operations_async.py | 28 +- ...tend_ip_configurations_operations_async.py | 13 +- ...r_load_balancing_rules_operations_async.py | 13 +- ...cer_network_interfaces_operations_async.py | 12 +- ...alancer_outbound_rules_operations_async.py | 13 +- .../_load_balancer_probes_operations_async.py | 13 +- .../_load_balancers_operations_async.py | 41 +- ...local_network_gateways_operations_async.py | 29 +- .../_nat_gateways_operations_async.py | 41 +- ...face_ip_configurations_operations_async.py | 13 +- ...terface_load_balancers_operations_async.py | 12 +- ...ace_tap_configurations_operations_async.py | 28 +- .../_network_interfaces_operations_async.py | 101 +- ...work_management_client_operations_async.py | 90 +- .../_network_profiles_operations_async.py | 35 +- ...etwork_security_groups_operations_async.py | 41 +- ...ork_virtual_appliances_operations_async.py | 41 +- .../_network_watchers_operations_async.py | 124 +- .../aio/operations_async/_operations_async.py | 12 +- .../_p2_svpn_gateways_operations_async.py | 81 +- .../_packet_captures_operations_async.py | 42 +- ...te_circuit_connections_operations_async.py | 13 +- ...rivate_dns_zone_groups_operations_async.py | 28 +- .../_private_endpoints_operations_async.py | 40 +- ..._private_link_services_operations_async.py | 257 +- .../_public_ip_addresses_operations_async.py | 66 +- .../_public_ip_prefixes_operations_async.py | 41 +- ...ource_navigation_links_operations_async.py | 1 - .../_route_filter_rules_operations_async.py | 28 +- .../_route_filters_operations_async.py | 41 +- .../_route_tables_operations_async.py | 41 +- .../_routes_operations_async.py | 28 +- ...rity_partner_providers_operations_async.py | 41 +- .../_security_rules_operations_async.py | 28 +- ...vice_association_links_operations_async.py | 1 - ...vice_endpoint_policies_operations_async.py | 41 +- ...int_policy_definitions_operations_async.py | 28 +- .../_service_tags_operations_async.py | 1 - .../_subnets_operations_async.py | 42 +- .../_usages_operations_async.py | 12 +- ...l_hub_route_table_v2_s_operations_async.py | 28 +- .../_virtual_hubs_operations_async.py | 41 +- ...rk_gateway_connections_operations_async.py | 81 +- ...rtual_network_gateways_operations_async.py | 195 +- ...rtual_network_peerings_operations_async.py | 28 +- .../_virtual_network_taps_operations_async.py | 41 +- .../_virtual_networks_operations_async.py | 54 +- ...irtual_router_peerings_operations_async.py | 28 +- .../_virtual_routers_operations_async.py | 40 +- .../_virtual_wans_operations_async.py | 41 +- .../_vpn_connections_operations_async.py | 28 +- .../_vpn_gateways_operations_async.py | 52 +- .../_vpn_link_connections_operations_async.py | 12 +- ...iated_with_virtual_wan_operations_async.py | 11 +- ..._server_configurations_operations_async.py | 41 +- ..._site_link_connections_operations_async.py | 1 - .../_vpn_site_links_operations_async.py | 13 +- ...pn_sites_configuration_operations_async.py | 7 +- .../_vpn_sites_operations_async.py | 41 +- ...tion_firewall_policies_operations_async.py | 34 +- .../network/v2020_04_01/models/__init__.py | 11 - .../network/v2020_04_01/models/_models.py | 137 +- .../network/v2020_04_01/models/_models_py3.py | 155 +- .../_network_management_client_enums.py | 7 - .../_application_gateways_operations.py | 71 +- ..._application_security_groups_operations.py | 33 +- .../_available_delegations_operations.py | 12 +- ..._available_endpoint_services_operations.py | 12 +- ...lable_private_endpoint_types_operations.py | 24 +- ...e_resource_group_delegations_operations.py | 12 +- .../_available_service_aliases_operations.py | 24 +- .../_azure_firewall_fqdn_tags_operations.py | 12 +- .../operations/_azure_firewalls_operations.py | 39 +- .../operations/_bastion_hosts_operations.py | 32 +- .../_bgp_service_communities_operations.py | 12 +- .../_connection_monitors_operations.py | 31 +- .../_ddos_custom_policies_operations.py | 9 +- .../_ddos_protection_plans_operations.py | 33 +- .../_default_security_rules_operations.py | 13 +- ...route_circuit_authorizations_operations.py | 20 +- ...ss_route_circuit_connections_operations.py | 20 +- ...press_route_circuit_peerings_operations.py | 20 +- .../_express_route_circuits_operations.py | 56 +- .../_express_route_connections_operations.py | 9 +- ...te_cross_connection_peerings_operations.py | 20 +- ...ress_route_cross_connections_operations.py | 50 +- .../_express_route_gateways_operations.py | 10 +- .../_express_route_links_operations.py | 13 +- ...xpress_route_ports_locations_operations.py | 13 +- .../_express_route_ports_operations.py | 33 +- ...ress_route_service_providers_operations.py | 12 +- .../_firewall_policies_operations.py | 32 +- ..._firewall_policy_rule_groups_operations.py | 20 +- .../operations/_flow_logs_operations.py | 20 +- .../_hub_route_tables_operations.py | 20 +- ..._virtual_network_connections_operations.py | 13 +- .../_inbound_nat_rules_operations.py | 20 +- .../operations/_ip_allocations_operations.py | 33 +- .../operations/_ip_groups_operations.py | 33 +- ...lancer_backend_address_pools_operations.py | 20 +- ...r_frontend_ip_configurations_operations.py | 13 +- ...alancer_load_balancing_rules_operations.py | 13 +- ..._balancer_network_interfaces_operations.py | 12 +- ...load_balancer_outbound_rules_operations.py | 13 +- .../_load_balancer_probes_operations.py | 13 +- .../operations/_load_balancers_operations.py | 33 +- .../_local_network_gateways_operations.py | 21 +- .../operations/_nat_gateways_operations.py | 33 +- ..._interface_ip_configurations_operations.py | 13 +- ...ork_interface_load_balancers_operations.py | 12 +- ...interface_tap_configurations_operations.py | 20 +- .../_network_interfaces_operations.py | 85 +- .../_network_management_client_operations.py | 74 +- .../_network_profiles_operations.py | 31 +- .../_network_security_groups_operations.py | 33 +- .../_network_virtual_appliances_operations.py | 33 +- .../_network_watchers_operations.py | 76 +- .../v2020_04_01/operations/_operations.py | 12 +- .../_p2_svpn_gateways_operations.py | 57 +- .../operations/_packet_captures_operations.py | 26 +- ...ss_route_circuit_connections_operations.py | 13 +- .../_private_dns_zone_groups_operations.py | 20 +- .../_private_endpoints_operations.py | 32 +- .../_private_link_services_operations.py | 247 +- .../_public_ip_addresses_operations.py | 58 +- .../_public_ip_prefixes_operations.py | 33 +- .../_resource_navigation_links_operations.py | 1 - .../_route_filter_rules_operations.py | 20 +- .../operations/_route_filters_operations.py | 33 +- .../operations/_route_tables_operations.py | 33 +- .../operations/_routes_operations.py | 20 +- .../_security_partner_providers_operations.py | 33 +- .../operations/_security_rules_operations.py | 20 +- .../_service_association_links_operations.py | 1 - .../_service_endpoint_policies_operations.py | 33 +- ..._endpoint_policy_definitions_operations.py | 20 +- .../operations/_service_tags_operations.py | 1 - .../operations/_subnets_operations.py | 26 +- .../operations/_usages_operations.py | 12 +- ...virtual_hub_route_table_v2_s_operations.py | 20 +- .../operations/_virtual_hubs_operations.py | 33 +- ..._network_gateway_connections_operations.py | 53 +- .../_virtual_network_gateways_operations.py | 127 +- .../_virtual_network_peerings_operations.py | 20 +- .../_virtual_network_taps_operations.py | 33 +- .../_virtual_networks_operations.py | 46 +- .../_virtual_router_peerings_operations.py | 20 +- .../operations/_virtual_routers_operations.py | 32 +- .../operations/_virtual_wans_operations.py | 33 +- .../operations/_vpn_connections_operations.py | 20 +- .../operations/_vpn_gateways_operations.py | 40 +- .../_vpn_link_connections_operations.py | 12 +- ..._associated_with_virtual_wan_operations.py | 7 +- .../_vpn_server_configurations_operations.py | 33 +- .../_vpn_site_link_connections_operations.py | 1 - .../operations/_vpn_site_links_operations.py | 13 +- .../_vpn_sites_configuration_operations.py | 3 +- .../operations/_vpn_sites_operations.py | 33 +- ...pplication_firewall_policies_operations.py | 30 +- .../mgmt/network/v2020_05_01/__init__.py | 16 + .../network/v2020_05_01/_configuration.py | 68 + .../mgmt/network/v2020_05_01/_metadata.json | 285 + .../v2020_05_01/_network_management_client.py | 570 + .../mgmt/network/v2020_05_01/aio/__init__.py | 10 + .../v2020_05_01/aio/_configuration_async.py | 64 + .../aio/_network_management_client_async.py | 564 + .../aio/operations_async/__init__.py | 215 + ...e_endpoint_connections_operations_async.py | 403 + ...private_link_resources_operations_async.py | 113 + .../_application_gateways_operations_async.py | 1299 + ...cation_security_groups_operations_async.py | 512 + ..._available_delegations_operations_async.py | 109 + ...able_endpoint_services_operations_async.py | 109 + ...private_endpoint_types_operations_async.py | 182 + ...urce_group_delegations_operations_async.py | 113 + ...ilable_service_aliases_operations_async.py | 180 + ...ure_firewall_fqdn_tags_operations_async.py | 105 + .../_azure_firewalls_operations_async.py | 565 + .../_bastion_hosts_operations_async.py | 447 + ...gp_service_communities_operations_async.py | 105 + .../_connection_monitors_operations_async.py | 803 + .../_ddos_custom_policies_operations_async.py | 380 + ..._ddos_protection_plans_operations_async.py | 511 + ...default_security_rules_operations_async.py | 172 + ...circuit_authorizations_operations_async.py | 405 + ...te_circuit_connections_operations_async.py | 427 + ...route_circuit_peerings_operations_async.py | 405 + ...express_route_circuits_operations_async.py | 985 + ...ress_route_connections_operations_async.py | 388 + ...ss_connection_peerings_operations_async.py | 405 + ...oute_cross_connections_operations_async.py | 771 + ...express_route_gateways_operations_async.py | 416 + .../_express_route_links_operations_async.py | 172 + ..._route_ports_locations_operations_async.py | 159 + .../_express_route_ports_operations_async.py | 511 + ...oute_service_providers_operations_async.py | 105 + .../_firewall_policies_operations_async.py | 452 + ...rule_collection_groups_operations_async.py | 405 + .../_flow_logs_operations_async.py | 408 + .../_hub_route_tables_operations_async.py | 404 + ...al_network_connections_operations_async.py | 405 + .../_inbound_nat_rules_operations_async.py | 410 + .../_ip_allocations_operations_async.py | 516 + .../_ip_groups_operations_async.py | 523 + ..._backend_address_pools_operations_async.py | 405 + ...tend_ip_configurations_operations_async.py | 172 + ...r_load_balancing_rules_operations_async.py | 172 + ...cer_network_interfaces_operations_async.py | 113 + ...alancer_outbound_rules_operations_async.py | 172 + .../_load_balancer_probes_operations_async.py | 172 + .../_load_balancers_operations_async.py | 516 + ...local_network_gateways_operations_async.py | 448 + .../_nat_gateways_operations_async.py | 519 + ...face_ip_configurations_operations_async.py | 172 + ...terface_load_balancers_operations_async.py | 113 + ...ace_tap_configurations_operations_async.py | 405 + .../_network_interfaces_operations_async.py | 1101 + ...work_management_client_operations_async.py | 759 + .../_network_profiles_operations_async.py | 464 + ...etwork_security_groups_operations_async.py | 517 + ...ork_virtual_appliances_operations_async.py | 516 + .../_network_watchers_operations_async.py | 1870 ++ .../aio/operations_async/_operations_async.py | 101 + .../_p2_svpn_gateways_operations_async.py | 969 + .../_packet_captures_operations_async.py | 625 + ...te_circuit_connections_operations_async.py | 182 + ...rivate_dns_zone_groups_operations_async.py | 406 + .../_private_endpoints_operations_async.py | 457 + ..._private_link_services_operations_async.py | 1140 + .../_public_ip_addresses_operations_async.py | 747 + .../_public_ip_prefixes_operations_async.py | 516 + ...ource_navigation_links_operations_async.py | 100 + .../_route_filter_rules_operations_async.py | 405 + .../_route_filters_operations_async.py | 517 + .../_route_tables_operations_async.py | 516 + .../_routes_operations_async.py | 404 + ...rity_partner_providers_operations_async.py | 512 + .../_security_rules_operations_async.py | 405 + ...vice_association_links_operations_async.py | 100 + ...vice_endpoint_policies_operations_async.py | 517 + ...int_policy_definitions_operations_async.py | 409 + .../_service_tags_operations_async.py | 94 + .../_subnets_operations_async.py | 641 + .../_usages_operations_async.py | 109 + ...irtual_appliance_sites_operations_async.py | 405 + ...virtual_appliance_skus_operations_async.py | 156 + ...ual_hub_bgp_connection_operations_async.py | 333 + ...al_hub_bgp_connections_operations_async.py | 113 + ...l_hub_ip_configuration_operations_async.py | 405 + ...l_hub_route_table_v2_s_operations_async.py | 409 + .../_virtual_hubs_operations_async.py | 624 + ...rk_gateway_connections_operations_async.py | 1055 + ...rtual_network_gateways_operations_async.py | 2278 ++ ...rtual_network_peerings_operations_async.py | 405 + .../_virtual_network_taps_operations_async.py | 511 + .../_virtual_networks_operations_async.py | 701 + ...irtual_router_peerings_operations_async.py | 409 + .../_virtual_routers_operations_async.py | 457 + .../_virtual_wans_operations_async.py | 511 + .../_vpn_connections_operations_async.py | 405 + .../_vpn_gateways_operations_async.py | 619 + .../_vpn_link_connections_operations_async.py | 118 + ...iated_with_virtual_wan_operations_async.py | 151 + ..._server_configurations_operations_async.py | 515 + ..._site_link_connections_operations_async.py | 104 + .../_vpn_site_links_operations_async.py | 172 + ...pn_sites_configuration_operations_async.py | 153 + .../_vpn_sites_operations_async.py | 511 + ...tion_firewall_policies_operations_async.py | 395 + .../network/v2020_05_01/models/__init__.py | 1810 ++ .../network/v2020_05_01/models/_models.py | 21199 +++++++++++++ .../network/v2020_05_01/models/_models_py3.py | 23548 +++++++++++++++ .../_network_management_client_enums.py | 1103 + .../v2020_05_01/operations/__init__.py | 215 + ...private_endpoint_connections_operations.py | 413 + ...teway_private_link_resources_operations.py | 118 + .../_application_gateways_operations.py | 1326 + ..._application_security_groups_operations.py | 524 + .../_available_delegations_operations.py | 114 + ..._available_endpoint_services_operations.py | 114 + ...lable_private_endpoint_types_operations.py | 188 + ...e_resource_group_delegations_operations.py | 118 + .../_available_service_aliases_operations.py | 186 + .../_azure_firewall_fqdn_tags_operations.py | 110 + .../operations/_azure_firewalls_operations.py | 578 + .../operations/_bastion_hosts_operations.py | 458 + .../_bgp_service_communities_operations.py | 110 + .../_connection_monitors_operations.py | 820 + .../_ddos_custom_policies_operations.py | 390 + .../_ddos_protection_plans_operations.py | 523 + .../_default_security_rules_operations.py | 178 + ...route_circuit_authorizations_operations.py | 415 + ...ss_route_circuit_connections_operations.py | 437 + ...press_route_circuit_peerings_operations.py | 415 + .../_express_route_circuits_operations.py | 1005 + .../_express_route_connections_operations.py | 398 + ...te_cross_connection_peerings_operations.py | 415 + ...ress_route_cross_connections_operations.py | 787 + .../_express_route_gateways_operations.py | 427 + .../_express_route_links_operations.py | 178 + ...xpress_route_ports_locations_operations.py | 165 + .../_express_route_ports_operations.py | 523 + ...ress_route_service_providers_operations.py | 110 + .../_firewall_policies_operations.py | 463 + ...olicy_rule_collection_groups_operations.py | 415 + .../operations/_flow_logs_operations.py | 418 + .../_hub_route_tables_operations.py | 414 + ..._virtual_network_connections_operations.py | 415 + .../_inbound_nat_rules_operations.py | 420 + .../operations/_ip_allocations_operations.py | 528 + .../operations/_ip_groups_operations.py | 535 + ...lancer_backend_address_pools_operations.py | 415 + ...r_frontend_ip_configurations_operations.py | 178 + ...alancer_load_balancing_rules_operations.py | 178 + ..._balancer_network_interfaces_operations.py | 118 + ...load_balancer_outbound_rules_operations.py | 178 + .../_load_balancer_probes_operations.py | 178 + .../operations/_load_balancers_operations.py | 528 + .../_local_network_gateways_operations.py | 459 + .../operations/_nat_gateways_operations.py | 531 + ..._interface_ip_configurations_operations.py | 178 + ...ork_interface_load_balancers_operations.py | 118 + ...interface_tap_configurations_operations.py | 415 + .../_network_interfaces_operations.py | 1122 + .../_network_management_client_operations.py | 775 + .../_network_profiles_operations.py | 475 + .../_network_security_groups_operations.py | 529 + .../_network_virtual_appliances_operations.py | 528 + .../_network_watchers_operations.py | 1904 ++ .../v2020_05_01/operations/_operations.py | 106 + .../_p2_svpn_gateways_operations.py | 989 + .../operations/_packet_captures_operations.py | 639 + ...ss_route_circuit_connections_operations.py | 188 + .../_private_dns_zone_groups_operations.py | 416 + .../_private_endpoints_operations.py | 468 + .../_private_link_services_operations.py | 1162 + .../_public_ip_addresses_operations.py | 762 + .../_public_ip_prefixes_operations.py | 528 + .../_resource_navigation_links_operations.py | 105 + .../_route_filter_rules_operations.py | 415 + .../operations/_route_filters_operations.py | 529 + .../operations/_route_tables_operations.py | 528 + .../operations/_routes_operations.py | 414 + .../_security_partner_providers_operations.py | 524 + .../operations/_security_rules_operations.py | 415 + .../_service_association_links_operations.py | 105 + .../_service_endpoint_policies_operations.py | 529 + ..._endpoint_policy_definitions_operations.py | 419 + .../operations/_service_tags_operations.py | 99 + .../operations/_subnets_operations.py | 655 + .../operations/_usages_operations.py | 114 + .../_virtual_appliance_sites_operations.py | 415 + .../_virtual_appliance_skus_operations.py | 162 + .../_virtual_hub_bgp_connection_operations.py | 342 + ..._virtual_hub_bgp_connections_operations.py | 118 + ...virtual_hub_ip_configuration_operations.py | 415 + ...virtual_hub_route_table_v2_s_operations.py | 419 + .../operations/_virtual_hubs_operations.py | 638 + ..._network_gateway_connections_operations.py | 1076 + .../_virtual_network_gateways_operations.py | 2321 ++ .../_virtual_network_peerings_operations.py | 415 + .../_virtual_network_taps_operations.py | 523 + .../_virtual_networks_operations.py | 716 + .../_virtual_router_peerings_operations.py | 419 + .../operations/_virtual_routers_operations.py | 468 + .../operations/_virtual_wans_operations.py | 523 + .../operations/_vpn_connections_operations.py | 415 + .../operations/_vpn_gateways_operations.py | 633 + .../_vpn_link_connections_operations.py | 123 + ..._associated_with_virtual_wan_operations.py | 157 + .../_vpn_server_configurations_operations.py | 527 + .../_vpn_site_link_connections_operations.py | 109 + .../operations/_vpn_site_links_operations.py | 178 + .../_vpn_sites_configuration_operations.py | 159 + .../operations/_vpn_sites_operations.py | 523 + ...pplication_firewall_policies_operations.py | 405 + .../azure/mgmt/network/v2020_05_01/py.typed | 1 + .../mgmt/network/v2020_06_01/__init__.py | 16 + .../network/v2020_06_01/_configuration.py | 68 + .../mgmt/network/v2020_06_01/_metadata.json | 288 + .../v2020_06_01/_network_management_client.py | 585 + .../mgmt/network/v2020_06_01/aio/__init__.py | 10 + .../v2020_06_01/aio/_configuration_async.py | 64 + .../aio/_network_management_client_async.py | 579 + .../aio/operations_async/__init__.py | 221 + ...e_endpoint_connections_operations_async.py | 403 + ...private_link_resources_operations_async.py | 113 + .../_application_gateways_operations_async.py | 1299 + ...cation_security_groups_operations_async.py | 512 + ..._available_delegations_operations_async.py | 109 + ...able_endpoint_services_operations_async.py | 109 + ...private_endpoint_types_operations_async.py | 182 + ...urce_group_delegations_operations_async.py | 113 + ...ilable_service_aliases_operations_async.py | 180 + ...ure_firewall_fqdn_tags_operations_async.py | 105 + .../_azure_firewalls_operations_async.py | 565 + .../_bastion_hosts_operations_async.py | 447 + ...gp_service_communities_operations_async.py | 105 + .../_connection_monitors_operations_async.py | 803 + .../_custom_ip_prefixes_operations_async.py | 516 + .../_ddos_custom_policies_operations_async.py | 380 + ..._ddos_protection_plans_operations_async.py | 511 + ...default_security_rules_operations_async.py | 172 + .../_dscp_configuration_operations_async.py | 447 + ...circuit_authorizations_operations_async.py | 405 + ...te_circuit_connections_operations_async.py | 427 + ...route_circuit_peerings_operations_async.py | 405 + ...express_route_circuits_operations_async.py | 985 + ...ress_route_connections_operations_async.py | 388 + ...ss_connection_peerings_operations_async.py | 405 + ...oute_cross_connections_operations_async.py | 771 + ...express_route_gateways_operations_async.py | 416 + .../_express_route_links_operations_async.py | 172 + ..._route_ports_locations_operations_async.py | 159 + .../_express_route_ports_operations_async.py | 575 + ...oute_service_providers_operations_async.py | 105 + .../_firewall_policies_operations_async.py | 452 + ...rule_collection_groups_operations_async.py | 405 + .../_flow_logs_operations_async.py | 477 + .../_hub_route_tables_operations_async.py | 404 + ...al_network_connections_operations_async.py | 405 + .../_inbound_nat_rules_operations_async.py | 410 + ..._inbound_security_rule_operations_async.py | 170 + .../_ip_allocations_operations_async.py | 516 + .../_ip_groups_operations_async.py | 523 + ..._backend_address_pools_operations_async.py | 405 + ...tend_ip_configurations_operations_async.py | 172 + ...r_load_balancing_rules_operations_async.py | 172 + ...cer_network_interfaces_operations_async.py | 113 + ...alancer_outbound_rules_operations_async.py | 172 + .../_load_balancer_probes_operations_async.py | 172 + .../_load_balancers_operations_async.py | 516 + ...local_network_gateways_operations_async.py | 448 + .../_nat_gateways_operations_async.py | 519 + ...face_ip_configurations_operations_async.py | 172 + ...terface_load_balancers_operations_async.py | 113 + ...ace_tap_configurations_operations_async.py | 405 + .../_network_interfaces_operations_async.py | 1101 + ...work_management_client_operations_async.py | 759 + .../_network_profiles_operations_async.py | 464 + ...etwork_security_groups_operations_async.py | 517 + ...ork_virtual_appliances_operations_async.py | 516 + .../_network_watchers_operations_async.py | 1870 ++ .../aio/operations_async/_operations_async.py | 101 + .../_p2_svpn_gateways_operations_async.py | 1130 + .../_packet_captures_operations_async.py | 625 + ...te_circuit_connections_operations_async.py | 182 + ...rivate_dns_zone_groups_operations_async.py | 406 + .../_private_endpoints_operations_async.py | 457 + ..._private_link_services_operations_async.py | 1140 + .../_public_ip_addresses_operations_async.py | 747 + .../_public_ip_prefixes_operations_async.py | 516 + ...ource_navigation_links_operations_async.py | 100 + .../_route_filter_rules_operations_async.py | 405 + .../_route_filters_operations_async.py | 517 + .../_route_tables_operations_async.py | 516 + .../_routes_operations_async.py | 404 + ...rity_partner_providers_operations_async.py | 512 + .../_security_rules_operations_async.py | 405 + ...vice_association_links_operations_async.py | 100 + ...vice_endpoint_policies_operations_async.py | 517 + ...int_policy_definitions_operations_async.py | 409 + .../_service_tags_operations_async.py | 94 + .../_subnets_operations_async.py | 641 + .../_usages_operations_async.py | 109 + ...irtual_appliance_sites_operations_async.py | 405 + ...virtual_appliance_skus_operations_async.py | 156 + ...ual_hub_bgp_connection_operations_async.py | 333 + ...al_hub_bgp_connections_operations_async.py | 341 + ...l_hub_ip_configuration_operations_async.py | 405 + ...l_hub_route_table_v2_s_operations_async.py | 409 + .../_virtual_hubs_operations_async.py | 624 + ...rk_gateway_connections_operations_async.py | 1055 + ...rtual_network_gateways_operations_async.py | 2278 ++ ...rtual_network_peerings_operations_async.py | 405 + .../_virtual_network_taps_operations_async.py | 511 + .../_virtual_networks_operations_async.py | 646 + ...irtual_router_peerings_operations_async.py | 409 + .../_virtual_routers_operations_async.py | 457 + .../_virtual_wans_operations_async.py | 511 + .../_vpn_connections_operations_async.py | 661 + .../_vpn_gateways_operations_async.py | 917 + .../_vpn_link_connections_operations_async.py | 118 + ...iated_with_virtual_wan_operations_async.py | 151 + ..._server_configurations_operations_async.py | 515 + ..._site_link_connections_operations_async.py | 104 + .../_vpn_site_links_operations_async.py | 172 + ...pn_sites_configuration_operations_async.py | 153 + .../_vpn_sites_operations_async.py | 511 + ...tion_firewall_policies_operations_async.py | 395 + .../network/v2020_06_01/models/__init__.py | 1896 ++ .../network/v2020_06_01/models/_models.py | 22075 ++++++++++++++ .../network/v2020_06_01/models/_models_py3.py | 24514 ++++++++++++++++ .../_network_management_client_enums.py | 1173 + .../v2020_06_01/operations/__init__.py | 221 + ...private_endpoint_connections_operations.py | 413 + ...teway_private_link_resources_operations.py | 118 + .../_application_gateways_operations.py | 1326 + ..._application_security_groups_operations.py | 524 + .../_available_delegations_operations.py | 114 + ..._available_endpoint_services_operations.py | 114 + ...lable_private_endpoint_types_operations.py | 188 + ...e_resource_group_delegations_operations.py | 118 + .../_available_service_aliases_operations.py | 186 + .../_azure_firewall_fqdn_tags_operations.py | 110 + .../operations/_azure_firewalls_operations.py | 578 + .../operations/_bastion_hosts_operations.py | 458 + .../_bgp_service_communities_operations.py | 110 + .../_connection_monitors_operations.py | 820 + .../_custom_ip_prefixes_operations.py | 528 + .../_ddos_custom_policies_operations.py | 390 + .../_ddos_protection_plans_operations.py | 523 + .../_default_security_rules_operations.py | 178 + .../_dscp_configuration_operations.py | 458 + ...route_circuit_authorizations_operations.py | 415 + ...ss_route_circuit_connections_operations.py | 437 + ...press_route_circuit_peerings_operations.py | 415 + .../_express_route_circuits_operations.py | 1005 + .../_express_route_connections_operations.py | 398 + ...te_cross_connection_peerings_operations.py | 415 + ...ress_route_cross_connections_operations.py | 787 + .../_express_route_gateways_operations.py | 427 + .../_express_route_links_operations.py | 178 + ...xpress_route_ports_locations_operations.py | 165 + .../_express_route_ports_operations.py | 588 + ...ress_route_service_providers_operations.py | 110 + .../_firewall_policies_operations.py | 463 + ...olicy_rule_collection_groups_operations.py | 415 + .../operations/_flow_logs_operations.py | 488 + .../_hub_route_tables_operations.py | 414 + ..._virtual_network_connections_operations.py | 415 + .../_inbound_nat_rules_operations.py | 420 + .../_inbound_security_rule_operations.py | 176 + .../operations/_ip_allocations_operations.py | 528 + .../operations/_ip_groups_operations.py | 535 + ...lancer_backend_address_pools_operations.py | 415 + ...r_frontend_ip_configurations_operations.py | 178 + ...alancer_load_balancing_rules_operations.py | 178 + ..._balancer_network_interfaces_operations.py | 118 + ...load_balancer_outbound_rules_operations.py | 178 + .../_load_balancer_probes_operations.py | 178 + .../operations/_load_balancers_operations.py | 528 + .../_local_network_gateways_operations.py | 459 + .../operations/_nat_gateways_operations.py | 531 + ..._interface_ip_configurations_operations.py | 178 + ...ork_interface_load_balancers_operations.py | 118 + ...interface_tap_configurations_operations.py | 415 + .../_network_interfaces_operations.py | 1122 + .../_network_management_client_operations.py | 775 + .../_network_profiles_operations.py | 475 + .../_network_security_groups_operations.py | 529 + .../_network_virtual_appliances_operations.py | 528 + .../_network_watchers_operations.py | 1904 ++ .../v2020_06_01/operations/_operations.py | 106 + .../_p2_svpn_gateways_operations.py | 1153 + .../operations/_packet_captures_operations.py | 639 + ...ss_route_circuit_connections_operations.py | 188 + .../_private_dns_zone_groups_operations.py | 416 + .../_private_endpoints_operations.py | 468 + .../_private_link_services_operations.py | 1162 + .../_public_ip_addresses_operations.py | 762 + .../_public_ip_prefixes_operations.py | 528 + .../_resource_navigation_links_operations.py | 105 + .../_route_filter_rules_operations.py | 415 + .../operations/_route_filters_operations.py | 529 + .../operations/_route_tables_operations.py | 528 + .../operations/_routes_operations.py | 414 + .../_security_partner_providers_operations.py | 524 + .../operations/_security_rules_operations.py | 415 + .../_service_association_links_operations.py | 105 + .../_service_endpoint_policies_operations.py | 529 + ..._endpoint_policy_definitions_operations.py | 419 + .../operations/_service_tags_operations.py | 99 + .../operations/_subnets_operations.py | 655 + .../operations/_usages_operations.py | 114 + .../_virtual_appliance_sites_operations.py | 415 + .../_virtual_appliance_skus_operations.py | 162 + .../_virtual_hub_bgp_connection_operations.py | 342 + ..._virtual_hub_bgp_connections_operations.py | 350 + ...virtual_hub_ip_configuration_operations.py | 415 + ...virtual_hub_route_table_v2_s_operations.py | 419 + .../operations/_virtual_hubs_operations.py | 638 + ..._network_gateway_connections_operations.py | 1076 + .../_virtual_network_gateways_operations.py | 2321 ++ .../_virtual_network_peerings_operations.py | 415 + .../_virtual_network_taps_operations.py | 523 + .../_virtual_networks_operations.py | 660 + .../_virtual_router_peerings_operations.py | 419 + .../operations/_virtual_routers_operations.py | 468 + .../operations/_virtual_wans_operations.py | 523 + .../operations/_vpn_connections_operations.py | 675 + .../operations/_vpn_gateways_operations.py | 936 + .../_vpn_link_connections_operations.py | 123 + ..._associated_with_virtual_wan_operations.py | 157 + .../_vpn_server_configurations_operations.py | 527 + .../_vpn_site_link_connections_operations.py | 109 + .../operations/_vpn_site_links_operations.py | 178 + .../_vpn_sites_configuration_operations.py | 159 + .../operations/_vpn_sites_operations.py | 523 + ...pplication_firewall_policies_operations.py | 405 + .../azure/mgmt/network/v2020_06_01/py.typed | 1 + 3781 files changed, 338308 insertions(+), 60932 deletions(-) create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_configuration.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_metadata.json create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_network_management_client.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_configuration_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_network_management_client_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_gateway_private_endpoint_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_gateway_private_link_resources_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_security_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_delegations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_endpoint_services_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_private_endpoint_types_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_resource_group_delegations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_service_aliases_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_azure_firewalls_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_bastion_hosts_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_bgp_service_communities_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_connection_monitors_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ddos_custom_policies_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ddos_protection_plans_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_default_security_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuit_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuits_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_cross_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_links_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_ports_locations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_ports_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_service_providers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_firewall_policies_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_firewall_policy_rule_collection_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_flow_logs_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_hub_route_tables_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_inbound_nat_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ip_allocations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ip_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_probes_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_local_network_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_nat_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interface_load_balancers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interfaces_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_management_client_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_profiles_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_security_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_virtual_appliances_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_watchers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_p2_svpn_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_packet_captures_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_private_dns_zone_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_private_endpoints_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_private_link_services_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_public_ip_addresses_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_public_ip_prefixes_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_resource_navigation_links_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_route_filter_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_route_filters_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_route_tables_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_routes_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_security_partner_providers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_security_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_association_links_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_endpoint_policies_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_tags_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_subnets_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_usages_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_appliance_sites_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_appliance_skus_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_bgp_connection_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_bgp_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_ip_configuration_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hubs_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_peerings_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_taps_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_networks_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_router_peerings_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_routers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_wans_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_link_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_server_configurations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_site_link_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_site_links_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_sites_configuration_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_sites_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_web_application_firewall_policies_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_models.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_models_py3.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_network_management_client_enums.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_endpoint_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_link_resources_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_security_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_delegations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_endpoint_services_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_private_endpoint_types_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_resource_group_delegations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_service_aliases_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewall_fqdn_tags_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewalls_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bastion_hosts_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bgp_service_communities_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_connection_monitors_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_custom_policies_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_protection_plans_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_default_security_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_authorizations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_peerings_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuits_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connection_peerings_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_links_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_locations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_service_providers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policies_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policy_rule_collection_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_flow_logs_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_route_tables_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_virtual_network_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_inbound_nat_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_allocations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_backend_address_pools_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_frontend_ip_configurations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_load_balancing_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_network_interfaces_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_outbound_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_probes_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_local_network_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_nat_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_ip_configurations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_load_balancers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_tap_configurations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interfaces_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_management_client_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_profiles_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_security_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_virtual_appliances_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_watchers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_p2_svpn_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_packet_captures_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_peer_express_route_circuit_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_dns_zone_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_endpoints_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_link_services_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_addresses_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_prefixes_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_resource_navigation_links_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filter_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filters_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_tables_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_routes_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_partner_providers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_association_links_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policies_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policy_definitions_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_tags_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_subnets_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_usages_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_sites_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_skus_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connection_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_ip_configuration_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_route_table_v2_s_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hubs_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateway_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_peerings_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_taps_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_networks_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_router_peerings_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_routers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_wans_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_link_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_link_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_links_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_configuration_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_web_application_firewall_policies_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/py.typed create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_configuration.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_metadata.json create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_network_management_client.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_configuration_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_network_management_client_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_gateway_private_endpoint_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_gateway_private_link_resources_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_security_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_delegations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_endpoint_services_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_private_endpoint_types_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_resource_group_delegations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_service_aliases_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_azure_firewalls_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_bastion_hosts_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_bgp_service_communities_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_connection_monitors_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_custom_ip_prefixes_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ddos_custom_policies_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_default_security_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_dscp_configuration_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuits_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_links_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_ports_locations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_ports_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_service_providers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_firewall_policies_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_firewall_policy_rule_collection_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_flow_logs_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_hub_route_tables_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_inbound_security_rule_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ip_allocations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ip_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_probes_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_local_network_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_nat_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interfaces_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_management_client_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_profiles_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_security_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_virtual_appliances_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_watchers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_p2_svpn_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_packet_captures_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_private_dns_zone_groups_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_private_endpoints_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_private_link_services_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_public_ip_addresses_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_public_ip_prefixes_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_resource_navigation_links_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_route_filter_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_route_filters_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_route_tables_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_routes_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_security_partner_providers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_security_rules_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_association_links_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_endpoint_policies_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_tags_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_subnets_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_usages_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_appliance_sites_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_appliance_skus_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_bgp_connection_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_bgp_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_ip_configuration_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hubs_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_taps_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_networks_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_router_peerings_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_routers_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_wans_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_gateways_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_link_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_server_configurations_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_site_link_connections_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_site_links_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_sites_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_web_application_firewall_policies_operations_async.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models_py3.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_network_management_client_enums.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/__init__.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_endpoint_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_link_resources_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_security_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_delegations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_endpoint_services_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_private_endpoint_types_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_resource_group_delegations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_service_aliases_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewall_fqdn_tags_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewalls_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bastion_hosts_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bgp_service_communities_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_connection_monitors_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_custom_ip_prefixes_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_custom_policies_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_protection_plans_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_default_security_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_dscp_configuration_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_authorizations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_peerings_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuits_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connection_peerings_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_links_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_locations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_service_providers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policies_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policy_rule_collection_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_flow_logs_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_route_tables_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_virtual_network_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_nat_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_security_rule_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_allocations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_backend_address_pools_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_frontend_ip_configurations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_load_balancing_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_network_interfaces_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_outbound_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_probes_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_local_network_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_nat_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_ip_configurations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_load_balancers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_tap_configurations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interfaces_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_management_client_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_profiles_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_security_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_virtual_appliances_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_watchers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_p2_svpn_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_packet_captures_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_peer_express_route_circuit_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_dns_zone_groups_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_endpoints_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_link_services_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_addresses_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_prefixes_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_resource_navigation_links_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filter_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filters_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_tables_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_routes_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_partner_providers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_rules_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_association_links_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policies_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policy_definitions_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_tags_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_subnets_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_usages_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_sites_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_skus_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connection_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_ip_configuration_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_route_table_v2_s_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hubs_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateway_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_peerings_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_taps_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_networks_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_router_peerings_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_routers_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_wans_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_gateways_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_link_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_link_connections_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_links_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_configuration_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_web_application_firewall_policies_operations.py create mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/py.typed 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 a09269fa7683..be5184d314e5 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,11 +46,12 @@ 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-04-01' + DEFAULT_API_VERSION = '2020-06-01' _PROFILE_TAG = "azure.mgmt.network.NetworkManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, + 'firewall_policy_rule_groups': '2020-04-01', 'interface_endpoints': '2019-02-01', 'p2_svpn_server_configurations': '2019-07-01', }}, @@ -113,6 +114,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-12-01: :mod:`v2019_12_01.models` * 2020-03-01: :mod:`v2020_03_01.models` * 2020-04-01: :mod:`v2020_04_01.models` + * 2020-05-01: :mod:`v2020_05_01.models` + * 2020-06-01: :mod:`v2020_06_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -198,8 +201,46 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-04-01': from .v2020_04_01 import models return models + elif api_version == '2020-05-01': + from .v2020_05_01 import models + return models + elif api_version == '2020-06-01': + from .v2020_06_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + @property + def application_gateway_private_endpoint_connections(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` + * 2020-06-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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def application_gateway_private_link_resources(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` + * 2020-06-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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def application_gateways(self): """Instance depends on the API version: @@ -232,6 +273,8 @@ def application_gateways(self): * 2019-12-01: :class:`ApplicationGatewaysOperations` * 2020-03-01: :class:`ApplicationGatewaysOperations` * 2020-04-01: :class:`ApplicationGatewaysOperations` + * 2020-05-01: :class:`ApplicationGatewaysOperations` + * 2020-06-01: :class:`ApplicationGatewaysOperations` """ api_version = self._get_api_version('application_gateways') if api_version == '2015-06-15': @@ -290,6 +333,10 @@ def application_gateways(self): from .v2020_03_01.operations import ApplicationGatewaysOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ApplicationGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -320,6 +367,8 @@ def application_security_groups(self): * 2019-12-01: :class:`ApplicationSecurityGroupsOperations` * 2020-03-01: :class:`ApplicationSecurityGroupsOperations` * 2020-04-01: :class:`ApplicationSecurityGroupsOperations` + * 2020-05-01: :class:`ApplicationSecurityGroupsOperations` + * 2020-06-01: :class:`ApplicationSecurityGroupsOperations` """ api_version = self._get_api_version('application_security_groups') if api_version == '2017-09-01': @@ -366,6 +415,10 @@ def application_security_groups(self): from .v2020_03_01.operations import ApplicationSecurityGroupsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ApplicationSecurityGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -388,6 +441,8 @@ def available_delegations(self): * 2019-12-01: :class:`AvailableDelegationsOperations` * 2020-03-01: :class:`AvailableDelegationsOperations` * 2020-04-01: :class:`AvailableDelegationsOperations` + * 2020-05-01: :class:`AvailableDelegationsOperations` + * 2020-06-01: :class:`AvailableDelegationsOperations` """ api_version = self._get_api_version('available_delegations') if api_version == '2018-08-01': @@ -418,6 +473,10 @@ def available_delegations(self): from .v2020_03_01.operations import AvailableDelegationsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import AvailableDelegationsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import AvailableDelegationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AvailableDelegationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -450,6 +509,8 @@ def available_endpoint_services(self): * 2019-12-01: :class:`AvailableEndpointServicesOperations` * 2020-03-01: :class:`AvailableEndpointServicesOperations` * 2020-04-01: :class:`AvailableEndpointServicesOperations` + * 2020-05-01: :class:`AvailableEndpointServicesOperations` + * 2020-06-01: :class:`AvailableEndpointServicesOperations` """ api_version = self._get_api_version('available_endpoint_services') if api_version == '2017-06-01': @@ -500,6 +561,10 @@ def available_endpoint_services(self): from .v2020_03_01.operations import AvailableEndpointServicesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AvailableEndpointServicesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -517,6 +582,8 @@ def available_private_endpoint_types(self): * 2019-12-01: :class:`AvailablePrivateEndpointTypesOperations` * 2020-03-01: :class:`AvailablePrivateEndpointTypesOperations` * 2020-04-01: :class:`AvailablePrivateEndpointTypesOperations` + * 2020-05-01: :class:`AvailablePrivateEndpointTypesOperations` + * 2020-06-01: :class:`AvailablePrivateEndpointTypesOperations` """ api_version = self._get_api_version('available_private_endpoint_types') if api_version == '2019-04-01': @@ -537,6 +604,10 @@ def available_private_endpoint_types(self): from .v2020_03_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -559,6 +630,8 @@ def available_resource_group_delegations(self): * 2019-12-01: :class:`AvailableResourceGroupDelegationsOperations` * 2020-03-01: :class:`AvailableResourceGroupDelegationsOperations` * 2020-04-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2020-05-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2020-06-01: :class:`AvailableResourceGroupDelegationsOperations` """ api_version = self._get_api_version('available_resource_group_delegations') if api_version == '2018-08-01': @@ -589,6 +662,10 @@ def available_resource_group_delegations(self): from .v2020_03_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -603,6 +680,8 @@ def available_service_aliases(self): * 2019-12-01: :class:`AvailableServiceAliasesOperations` * 2020-03-01: :class:`AvailableServiceAliasesOperations` * 2020-04-01: :class:`AvailableServiceAliasesOperations` + * 2020-05-01: :class:`AvailableServiceAliasesOperations` + * 2020-06-01: :class:`AvailableServiceAliasesOperations` """ api_version = self._get_api_version('available_service_aliases') if api_version == '2019-08-01': @@ -617,6 +696,10 @@ def available_service_aliases(self): from .v2020_03_01.operations import AvailableServiceAliasesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import AvailableServiceAliasesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import AvailableServiceAliasesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AvailableServiceAliasesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -639,6 +722,8 @@ def azure_firewall_fqdn_tags(self): * 2019-12-01: :class:`AzureFirewallFqdnTagsOperations` * 2020-03-01: :class:`AzureFirewallFqdnTagsOperations` * 2020-04-01: :class:`AzureFirewallFqdnTagsOperations` + * 2020-05-01: :class:`AzureFirewallFqdnTagsOperations` + * 2020-06-01: :class:`AzureFirewallFqdnTagsOperations` """ api_version = self._get_api_version('azure_firewall_fqdn_tags') if api_version == '2018-08-01': @@ -669,6 +754,10 @@ def azure_firewall_fqdn_tags(self): from .v2020_03_01.operations import AzureFirewallFqdnTagsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AzureFirewallFqdnTagsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -694,6 +783,8 @@ def azure_firewalls(self): * 2019-12-01: :class:`AzureFirewallsOperations` * 2020-03-01: :class:`AzureFirewallsOperations` * 2020-04-01: :class:`AzureFirewallsOperations` + * 2020-05-01: :class:`AzureFirewallsOperations` + * 2020-06-01: :class:`AzureFirewallsOperations` """ api_version = self._get_api_version('azure_firewalls') if api_version == '2018-04-01': @@ -730,6 +821,10 @@ def azure_firewalls(self): from .v2020_03_01.operations import AzureFirewallsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AzureFirewallsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -747,6 +842,8 @@ def bastion_hosts(self): * 2019-12-01: :class:`BastionHostsOperations` * 2020-03-01: :class:`BastionHostsOperations` * 2020-04-01: :class:`BastionHostsOperations` + * 2020-05-01: :class:`BastionHostsOperations` + * 2020-06-01: :class:`BastionHostsOperations` """ api_version = self._get_api_version('bastion_hosts') if api_version == '2019-04-01': @@ -767,6 +864,10 @@ def bastion_hosts(self): from .v2020_03_01.operations import BastionHostsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import BastionHostsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import BastionHostsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import BastionHostsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -801,6 +902,8 @@ def bgp_service_communities(self): * 2019-12-01: :class:`BgpServiceCommunitiesOperations` * 2020-03-01: :class:`BgpServiceCommunitiesOperations` * 2020-04-01: :class:`BgpServiceCommunitiesOperations` + * 2020-05-01: :class:`BgpServiceCommunitiesOperations` + * 2020-06-01: :class:`BgpServiceCommunitiesOperations` """ api_version = self._get_api_version('bgp_service_communities') if api_version == '2016-12-01': @@ -855,6 +958,10 @@ def bgp_service_communities(self): from .v2020_03_01.operations import BgpServiceCommunitiesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import BgpServiceCommunitiesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -884,6 +991,8 @@ def connection_monitors(self): * 2019-12-01: :class:`ConnectionMonitorsOperations` * 2020-03-01: :class:`ConnectionMonitorsOperations` * 2020-04-01: :class:`ConnectionMonitorsOperations` + * 2020-05-01: :class:`ConnectionMonitorsOperations` + * 2020-06-01: :class:`ConnectionMonitorsOperations` """ api_version = self._get_api_version('connection_monitors') if api_version == '2017-10-01': @@ -928,6 +1037,23 @@ def connection_monitors(self): from .v2020_03_01.operations import ConnectionMonitorsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ConnectionMonitorsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def custom_ip_prefixes(self): + """Instance depends on the API version: + + * 2020-06-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 else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -948,6 +1074,8 @@ def ddos_custom_policies(self): * 2019-12-01: :class:`DdosCustomPoliciesOperations` * 2020-03-01: :class:`DdosCustomPoliciesOperations` * 2020-04-01: :class:`DdosCustomPoliciesOperations` + * 2020-05-01: :class:`DdosCustomPoliciesOperations` + * 2020-06-01: :class:`DdosCustomPoliciesOperations` """ api_version = self._get_api_version('ddos_custom_policies') if api_version == '2018-11-01': @@ -974,6 +1102,10 @@ def ddos_custom_policies(self): from .v2020_03_01.operations import DdosCustomPoliciesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import DdosCustomPoliciesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import DdosCustomPoliciesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import DdosCustomPoliciesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1000,6 +1132,8 @@ def ddos_protection_plans(self): * 2019-12-01: :class:`DdosProtectionPlansOperations` * 2020-03-01: :class:`DdosProtectionPlansOperations` * 2020-04-01: :class:`DdosProtectionPlansOperations` + * 2020-05-01: :class:`DdosProtectionPlansOperations` + * 2020-06-01: :class:`DdosProtectionPlansOperations` """ api_version = self._get_api_version('ddos_protection_plans') if api_version == '2018-02-01': @@ -1038,6 +1172,10 @@ def ddos_protection_plans(self): from .v2020_03_01.operations import DdosProtectionPlansOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import DdosProtectionPlansOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1070,6 +1208,8 @@ def default_security_rules(self): * 2019-12-01: :class:`DefaultSecurityRulesOperations` * 2020-03-01: :class:`DefaultSecurityRulesOperations` * 2020-04-01: :class:`DefaultSecurityRulesOperations` + * 2020-05-01: :class:`DefaultSecurityRulesOperations` + * 2020-06-01: :class:`DefaultSecurityRulesOperations` """ api_version = self._get_api_version('default_security_rules') if api_version == '2017-06-01': @@ -1120,6 +1260,23 @@ def default_security_rules(self): from .v2020_03_01.operations import DefaultSecurityRulesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import DefaultSecurityRulesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def dscp_configuration(self): + """Instance depends on the API version: + + * 2020-06-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 else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1156,6 +1313,8 @@ def express_route_circuit_authorizations(self): * 2019-12-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2020-03-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2020-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2020-05-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2020-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` """ api_version = self._get_api_version('express_route_circuit_authorizations') if api_version == '2015-06-15': @@ -1214,6 +1373,10 @@ def express_route_circuit_authorizations(self): from .v2020_03_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1240,6 +1403,8 @@ def express_route_circuit_connections(self): * 2019-12-01: :class:`ExpressRouteCircuitConnectionsOperations` * 2020-03-01: :class:`ExpressRouteCircuitConnectionsOperations` * 2020-04-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2020-05-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2020-06-01: :class:`ExpressRouteCircuitConnectionsOperations` """ api_version = self._get_api_version('express_route_circuit_connections') if api_version == '2018-02-01': @@ -1278,6 +1443,10 @@ def express_route_circuit_connections(self): from .v2020_03_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1314,6 +1483,8 @@ def express_route_circuit_peerings(self): * 2019-12-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2020-03-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2020-04-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2020-05-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2020-06-01: :class:`ExpressRouteCircuitPeeringsOperations` """ api_version = self._get_api_version('express_route_circuit_peerings') if api_version == '2015-06-15': @@ -1372,6 +1543,10 @@ def express_route_circuit_peerings(self): from .v2020_03_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1408,6 +1583,8 @@ def express_route_circuits(self): * 2019-12-01: :class:`ExpressRouteCircuitsOperations` * 2020-03-01: :class:`ExpressRouteCircuitsOperations` * 2020-04-01: :class:`ExpressRouteCircuitsOperations` + * 2020-05-01: :class:`ExpressRouteCircuitsOperations` + * 2020-06-01: :class:`ExpressRouteCircuitsOperations` """ api_version = self._get_api_version('express_route_circuits') if api_version == '2015-06-15': @@ -1466,6 +1643,10 @@ def express_route_circuits(self): from .v2020_03_01.operations import ExpressRouteCircuitsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteCircuitsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1488,6 +1669,8 @@ def express_route_connections(self): * 2019-12-01: :class:`ExpressRouteConnectionsOperations` * 2020-03-01: :class:`ExpressRouteConnectionsOperations` * 2020-04-01: :class:`ExpressRouteConnectionsOperations` + * 2020-05-01: :class:`ExpressRouteConnectionsOperations` + * 2020-06-01: :class:`ExpressRouteConnectionsOperations` """ api_version = self._get_api_version('express_route_connections') if api_version == '2018-08-01': @@ -1518,6 +1701,10 @@ def express_route_connections(self): from .v2020_03_01.operations import ExpressRouteConnectionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1544,6 +1731,8 @@ def express_route_cross_connection_peerings(self): * 2019-12-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` * 2020-03-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` * 2020-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2020-05-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2020-06-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` """ api_version = self._get_api_version('express_route_cross_connection_peerings') if api_version == '2018-02-01': @@ -1582,6 +1771,10 @@ def express_route_cross_connection_peerings(self): from .v2020_03_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1608,6 +1801,8 @@ def express_route_cross_connections(self): * 2019-12-01: :class:`ExpressRouteCrossConnectionsOperations` * 2020-03-01: :class:`ExpressRouteCrossConnectionsOperations` * 2020-04-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2020-05-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2020-06-01: :class:`ExpressRouteCrossConnectionsOperations` """ api_version = self._get_api_version('express_route_cross_connections') if api_version == '2018-02-01': @@ -1646,6 +1841,10 @@ def express_route_cross_connections(self): from .v2020_03_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1668,6 +1867,8 @@ def express_route_gateways(self): * 2019-12-01: :class:`ExpressRouteGatewaysOperations` * 2020-03-01: :class:`ExpressRouteGatewaysOperations` * 2020-04-01: :class:`ExpressRouteGatewaysOperations` + * 2020-05-01: :class:`ExpressRouteGatewaysOperations` + * 2020-06-01: :class:`ExpressRouteGatewaysOperations` """ api_version = self._get_api_version('express_route_gateways') if api_version == '2018-08-01': @@ -1698,6 +1899,10 @@ def express_route_gateways(self): from .v2020_03_01.operations import ExpressRouteGatewaysOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1720,6 +1925,8 @@ def express_route_links(self): * 2019-12-01: :class:`ExpressRouteLinksOperations` * 2020-03-01: :class:`ExpressRouteLinksOperations` * 2020-04-01: :class:`ExpressRouteLinksOperations` + * 2020-05-01: :class:`ExpressRouteLinksOperations` + * 2020-06-01: :class:`ExpressRouteLinksOperations` """ api_version = self._get_api_version('express_route_links') if api_version == '2018-08-01': @@ -1750,6 +1957,10 @@ def express_route_links(self): from .v2020_03_01.operations import ExpressRouteLinksOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteLinksOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteLinksOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteLinksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1772,6 +1983,8 @@ def express_route_ports(self): * 2019-12-01: :class:`ExpressRoutePortsOperations` * 2020-03-01: :class:`ExpressRoutePortsOperations` * 2020-04-01: :class:`ExpressRoutePortsOperations` + * 2020-05-01: :class:`ExpressRoutePortsOperations` + * 2020-06-01: :class:`ExpressRoutePortsOperations` """ api_version = self._get_api_version('express_route_ports') if api_version == '2018-08-01': @@ -1802,6 +2015,10 @@ def express_route_ports(self): from .v2020_03_01.operations import ExpressRoutePortsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRoutePortsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRoutePortsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRoutePortsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1824,6 +2041,8 @@ def express_route_ports_locations(self): * 2019-12-01: :class:`ExpressRoutePortsLocationsOperations` * 2020-03-01: :class:`ExpressRoutePortsLocationsOperations` * 2020-04-01: :class:`ExpressRoutePortsLocationsOperations` + * 2020-05-01: :class:`ExpressRoutePortsLocationsOperations` + * 2020-06-01: :class:`ExpressRoutePortsLocationsOperations` """ api_version = self._get_api_version('express_route_ports_locations') if api_version == '2018-08-01': @@ -1854,6 +2073,10 @@ def express_route_ports_locations(self): from .v2020_03_01.operations import ExpressRoutePortsLocationsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRoutePortsLocationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1890,6 +2113,8 @@ def express_route_service_providers(self): * 2019-12-01: :class:`ExpressRouteServiceProvidersOperations` * 2020-03-01: :class:`ExpressRouteServiceProvidersOperations` * 2020-04-01: :class:`ExpressRouteServiceProvidersOperations` + * 2020-05-01: :class:`ExpressRouteServiceProvidersOperations` + * 2020-06-01: :class:`ExpressRouteServiceProvidersOperations` """ api_version = self._get_api_version('express_route_service_providers') if api_version == '2015-06-15': @@ -1948,6 +2173,10 @@ def express_route_service_providers(self): from .v2020_03_01.operations import ExpressRouteServiceProvidersOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1964,6 +2193,8 @@ def firewall_policies(self): * 2019-12-01: :class:`FirewallPoliciesOperations` * 2020-03-01: :class:`FirewallPoliciesOperations` * 2020-04-01: :class:`FirewallPoliciesOperations` + * 2020-05-01: :class:`FirewallPoliciesOperations` + * 2020-06-01: :class:`FirewallPoliciesOperations` """ api_version = self._get_api_version('firewall_policies') if api_version == '2019-06-01': @@ -1982,6 +2213,26 @@ def firewall_policies(self): from .v2020_03_01.operations import FirewallPoliciesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import FirewallPoliciesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import FirewallPoliciesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import FirewallPoliciesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def firewall_policy_rule_collection_groups(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` + * 2020-06-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 else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2028,6 +2279,8 @@ def flow_logs(self): * 2019-12-01: :class:`FlowLogsOperations` * 2020-03-01: :class:`FlowLogsOperations` * 2020-04-01: :class:`FlowLogsOperations` + * 2020-05-01: :class:`FlowLogsOperations` + * 2020-06-01: :class:`FlowLogsOperations` """ api_version = self._get_api_version('flow_logs') if api_version == '2019-11-01': @@ -2038,6 +2291,10 @@ def flow_logs(self): from .v2020_03_01.operations import FlowLogsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import FlowLogsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import FlowLogsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import FlowLogsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2047,10 +2304,16 @@ def hub_route_tables(self): """Instance depends on the API version: * 2020-04-01: :class:`HubRouteTablesOperations` + * 2020-05-01: :class:`HubRouteTablesOperations` + * 2020-06-01: :class:`HubRouteTablesOperations` """ api_version = self._get_api_version('hub_route_tables') if api_version == '2020-04-01': from .v2020_04_01.operations import HubRouteTablesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import HubRouteTablesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import HubRouteTablesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2076,6 +2339,8 @@ def hub_virtual_network_connections(self): * 2019-12-01: :class:`HubVirtualNetworkConnectionsOperations` * 2020-03-01: :class:`HubVirtualNetworkConnectionsOperations` * 2020-04-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2020-05-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2020-06-01: :class:`HubVirtualNetworkConnectionsOperations` """ api_version = self._get_api_version('hub_virtual_network_connections') if api_version == '2018-04-01': @@ -2112,6 +2377,10 @@ def hub_virtual_network_connections(self): from .v2020_03_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2144,6 +2413,8 @@ def inbound_nat_rules(self): * 2019-12-01: :class:`InboundNatRulesOperations` * 2020-03-01: :class:`InboundNatRulesOperations` * 2020-04-01: :class:`InboundNatRulesOperations` + * 2020-05-01: :class:`InboundNatRulesOperations` + * 2020-06-01: :class:`InboundNatRulesOperations` """ api_version = self._get_api_version('inbound_nat_rules') if api_version == '2017-06-01': @@ -2194,6 +2465,23 @@ def inbound_nat_rules(self): from .v2020_03_01.operations import InboundNatRulesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import InboundNatRulesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def inbound_security_rule(self): + """Instance depends on the API version: + + * 2020-06-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 else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2229,12 +2517,18 @@ def ip_allocations(self): * 2020-03-01: :class:`IpAllocationsOperations` * 2020-04-01: :class:`IpAllocationsOperations` + * 2020-05-01: :class:`IpAllocationsOperations` + * 2020-06-01: :class:`IpAllocationsOperations` """ api_version = self._get_api_version('ip_allocations') if api_version == '2020-03-01': from .v2020_03_01.operations import IpAllocationsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import IpAllocationsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import IpAllocationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import IpAllocationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2248,6 +2542,8 @@ def ip_groups(self): * 2019-12-01: :class:`IpGroupsOperations` * 2020-03-01: :class:`IpGroupsOperations` * 2020-04-01: :class:`IpGroupsOperations` + * 2020-05-01: :class:`IpGroupsOperations` + * 2020-06-01: :class:`IpGroupsOperations` """ api_version = self._get_api_version('ip_groups') if api_version == '2019-09-01': @@ -2260,6 +2556,10 @@ def ip_groups(self): from .v2020_03_01.operations import IpGroupsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import IpGroupsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import IpGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import IpGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2292,6 +2592,8 @@ def load_balancer_backend_address_pools(self): * 2019-12-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2020-03-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2020-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2020-05-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2020-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` """ api_version = self._get_api_version('load_balancer_backend_address_pools') if api_version == '2017-06-01': @@ -2342,6 +2644,10 @@ def load_balancer_backend_address_pools(self): from .v2020_03_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2374,6 +2680,8 @@ def load_balancer_frontend_ip_configurations(self): * 2019-12-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2020-03-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2020-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2020-05-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2020-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` """ api_version = self._get_api_version('load_balancer_frontend_ip_configurations') if api_version == '2017-06-01': @@ -2424,6 +2732,10 @@ def load_balancer_frontend_ip_configurations(self): from .v2020_03_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2456,6 +2768,8 @@ def load_balancer_load_balancing_rules(self): * 2019-12-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2020-03-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2020-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2020-05-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2020-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` """ api_version = self._get_api_version('load_balancer_load_balancing_rules') if api_version == '2017-06-01': @@ -2506,6 +2820,10 @@ def load_balancer_load_balancing_rules(self): from .v2020_03_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2538,6 +2856,8 @@ def load_balancer_network_interfaces(self): * 2019-12-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2020-03-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2020-04-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2020-05-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2020-06-01: :class:`LoadBalancerNetworkInterfacesOperations` """ api_version = self._get_api_version('load_balancer_network_interfaces') if api_version == '2017-06-01': @@ -2588,6 +2908,10 @@ def load_balancer_network_interfaces(self): from .v2020_03_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2610,6 +2934,8 @@ def load_balancer_outbound_rules(self): * 2019-12-01: :class:`LoadBalancerOutboundRulesOperations` * 2020-03-01: :class:`LoadBalancerOutboundRulesOperations` * 2020-04-01: :class:`LoadBalancerOutboundRulesOperations` + * 2020-05-01: :class:`LoadBalancerOutboundRulesOperations` + * 2020-06-01: :class:`LoadBalancerOutboundRulesOperations` """ api_version = self._get_api_version('load_balancer_outbound_rules') if api_version == '2018-08-01': @@ -2640,6 +2966,10 @@ def load_balancer_outbound_rules(self): from .v2020_03_01.operations import LoadBalancerOutboundRulesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import LoadBalancerOutboundRulesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2672,6 +3002,8 @@ def load_balancer_probes(self): * 2019-12-01: :class:`LoadBalancerProbesOperations` * 2020-03-01: :class:`LoadBalancerProbesOperations` * 2020-04-01: :class:`LoadBalancerProbesOperations` + * 2020-05-01: :class:`LoadBalancerProbesOperations` + * 2020-06-01: :class:`LoadBalancerProbesOperations` """ api_version = self._get_api_version('load_balancer_probes') if api_version == '2017-06-01': @@ -2722,6 +3054,10 @@ def load_balancer_probes(self): from .v2020_03_01.operations import LoadBalancerProbesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import LoadBalancerProbesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2758,6 +3094,8 @@ def load_balancers(self): * 2019-12-01: :class:`LoadBalancersOperations` * 2020-03-01: :class:`LoadBalancersOperations` * 2020-04-01: :class:`LoadBalancersOperations` + * 2020-05-01: :class:`LoadBalancersOperations` + * 2020-06-01: :class:`LoadBalancersOperations` """ api_version = self._get_api_version('load_balancers') if api_version == '2015-06-15': @@ -2816,6 +3154,10 @@ def load_balancers(self): from .v2020_03_01.operations import LoadBalancersOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import LoadBalancersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2852,6 +3194,8 @@ def local_network_gateways(self): * 2019-12-01: :class:`LocalNetworkGatewaysOperations` * 2020-03-01: :class:`LocalNetworkGatewaysOperations` * 2020-04-01: :class:`LocalNetworkGatewaysOperations` + * 2020-05-01: :class:`LocalNetworkGatewaysOperations` + * 2020-06-01: :class:`LocalNetworkGatewaysOperations` """ api_version = self._get_api_version('local_network_gateways') if api_version == '2015-06-15': @@ -2910,6 +3254,10 @@ def local_network_gateways(self): from .v2020_03_01.operations import LocalNetworkGatewaysOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import LocalNetworkGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2928,6 +3276,8 @@ def nat_gateways(self): * 2019-12-01: :class:`NatGatewaysOperations` * 2020-03-01: :class:`NatGatewaysOperations` * 2020-04-01: :class:`NatGatewaysOperations` + * 2020-05-01: :class:`NatGatewaysOperations` + * 2020-06-01: :class:`NatGatewaysOperations` """ api_version = self._get_api_version('nat_gateways') if api_version == '2019-02-01': @@ -2950,6 +3300,10 @@ def nat_gateways(self): from .v2020_03_01.operations import NatGatewaysOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NatGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NatGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NatGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2982,6 +3336,8 @@ def network_interface_ip_configurations(self): * 2019-12-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2020-03-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2020-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2020-05-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2020-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` """ api_version = self._get_api_version('network_interface_ip_configurations') if api_version == '2017-06-01': @@ -3032,6 +3388,10 @@ def network_interface_ip_configurations(self): from .v2020_03_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3064,6 +3424,8 @@ def network_interface_load_balancers(self): * 2019-12-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2020-03-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2020-04-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2020-05-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2020-06-01: :class:`NetworkInterfaceLoadBalancersOperations` """ api_version = self._get_api_version('network_interface_load_balancers') if api_version == '2017-06-01': @@ -3114,6 +3476,10 @@ def network_interface_load_balancers(self): from .v2020_03_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3136,6 +3502,8 @@ def network_interface_tap_configurations(self): * 2019-12-01: :class:`NetworkInterfaceTapConfigurationsOperations` * 2020-03-01: :class:`NetworkInterfaceTapConfigurationsOperations` * 2020-04-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2020-05-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2020-06-01: :class:`NetworkInterfaceTapConfigurationsOperations` """ api_version = self._get_api_version('network_interface_tap_configurations') if api_version == '2018-08-01': @@ -3166,6 +3534,10 @@ def network_interface_tap_configurations(self): from .v2020_03_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3202,6 +3574,8 @@ def network_interfaces(self): * 2019-12-01: :class:`NetworkInterfacesOperations` * 2020-03-01: :class:`NetworkInterfacesOperations` * 2020-04-01: :class:`NetworkInterfacesOperations` + * 2020-05-01: :class:`NetworkInterfacesOperations` + * 2020-06-01: :class:`NetworkInterfacesOperations` """ api_version = self._get_api_version('network_interfaces') if api_version == '2015-06-15': @@ -3260,6 +3634,10 @@ def network_interfaces(self): from .v2020_03_01.operations import NetworkInterfacesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkInterfacesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3282,6 +3660,8 @@ def network_profiles(self): * 2019-12-01: :class:`NetworkProfilesOperations` * 2020-03-01: :class:`NetworkProfilesOperations` * 2020-04-01: :class:`NetworkProfilesOperations` + * 2020-05-01: :class:`NetworkProfilesOperations` + * 2020-06-01: :class:`NetworkProfilesOperations` """ api_version = self._get_api_version('network_profiles') if api_version == '2018-08-01': @@ -3312,6 +3692,10 @@ def network_profiles(self): from .v2020_03_01.operations import NetworkProfilesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkProfilesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkProfilesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkProfilesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3348,6 +3732,8 @@ def network_security_groups(self): * 2019-12-01: :class:`NetworkSecurityGroupsOperations` * 2020-03-01: :class:`NetworkSecurityGroupsOperations` * 2020-04-01: :class:`NetworkSecurityGroupsOperations` + * 2020-05-01: :class:`NetworkSecurityGroupsOperations` + * 2020-06-01: :class:`NetworkSecurityGroupsOperations` """ api_version = self._get_api_version('network_security_groups') if api_version == '2015-06-15': @@ -3406,6 +3792,10 @@ def network_security_groups(self): from .v2020_03_01.operations import NetworkSecurityGroupsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkSecurityGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3417,6 +3807,8 @@ def network_virtual_appliances(self): * 2019-12-01: :class:`NetworkVirtualAppliancesOperations` * 2020-03-01: :class:`NetworkVirtualAppliancesOperations` * 2020-04-01: :class:`NetworkVirtualAppliancesOperations` + * 2020-05-01: :class:`NetworkVirtualAppliancesOperations` + * 2020-06-01: :class:`NetworkVirtualAppliancesOperations` """ api_version = self._get_api_version('network_virtual_appliances') if api_version == '2019-12-01': @@ -3425,6 +3817,10 @@ def network_virtual_appliances(self): from .v2020_03_01.operations import NetworkVirtualAppliancesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkVirtualAppliancesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkVirtualAppliancesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkVirtualAppliancesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3460,6 +3856,8 @@ def network_watchers(self): * 2019-12-01: :class:`NetworkWatchersOperations` * 2020-03-01: :class:`NetworkWatchersOperations` * 2020-04-01: :class:`NetworkWatchersOperations` + * 2020-05-01: :class:`NetworkWatchersOperations` + * 2020-06-01: :class:`NetworkWatchersOperations` """ api_version = self._get_api_version('network_watchers') if api_version == '2016-09-01': @@ -3516,6 +3914,10 @@ def network_watchers(self): from .v2020_03_01.operations import NetworkWatchersOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkWatchersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3546,6 +3948,8 @@ def operations(self): * 2019-12-01: :class:`Operations` * 2020-03-01: :class:`Operations` * 2020-04-01: :class:`Operations` + * 2020-05-01: :class:`Operations` + * 2020-06-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-09-01': @@ -3592,6 +3996,10 @@ def operations(self): from .v2020_03_01.operations import Operations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import Operations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import Operations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import Operations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3614,6 +4022,8 @@ def p2_svpn_gateways(self): * 2019-12-01: :class:`P2SVpnGatewaysOperations` * 2020-03-01: :class:`P2SVpnGatewaysOperations` * 2020-04-01: :class:`P2SVpnGatewaysOperations` + * 2020-05-01: :class:`P2SVpnGatewaysOperations` + * 2020-06-01: :class:`P2SVpnGatewaysOperations` """ api_version = self._get_api_version('p2_svpn_gateways') if api_version == '2018-08-01': @@ -3644,6 +4054,10 @@ def p2_svpn_gateways(self): from .v2020_03_01.operations import P2SVpnGatewaysOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import P2SVpnGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import P2SVpnGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import P2SVpnGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3713,6 +4127,8 @@ def packet_captures(self): * 2019-12-01: :class:`PacketCapturesOperations` * 2020-03-01: :class:`PacketCapturesOperations` * 2020-04-01: :class:`PacketCapturesOperations` + * 2020-05-01: :class:`PacketCapturesOperations` + * 2020-06-01: :class:`PacketCapturesOperations` """ api_version = self._get_api_version('packet_captures') if api_version == '2016-09-01': @@ -3769,6 +4185,10 @@ def packet_captures(self): from .v2020_03_01.operations import PacketCapturesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import PacketCapturesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3788,6 +4208,8 @@ def peer_express_route_circuit_connections(self): * 2019-12-01: :class:`PeerExpressRouteCircuitConnectionsOperations` * 2020-03-01: :class:`PeerExpressRouteCircuitConnectionsOperations` * 2020-04-01: :class:`PeerExpressRouteCircuitConnectionsOperations` + * 2020-05-01: :class:`PeerExpressRouteCircuitConnectionsOperations` + * 2020-06-01: :class:`PeerExpressRouteCircuitConnectionsOperations` """ api_version = self._get_api_version('peer_express_route_circuit_connections') if api_version == '2018-12-01': @@ -3812,6 +4234,10 @@ def peer_express_route_circuit_connections(self): from .v2020_03_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3822,12 +4248,18 @@ def private_dns_zone_groups(self): * 2020-03-01: :class:`PrivateDnsZoneGroupsOperations` * 2020-04-01: :class:`PrivateDnsZoneGroupsOperations` + * 2020-05-01: :class:`PrivateDnsZoneGroupsOperations` + * 2020-06-01: :class:`PrivateDnsZoneGroupsOperations` """ api_version = self._get_api_version('private_dns_zone_groups') if api_version == '2020-03-01': from .v2020_03_01.operations import PrivateDnsZoneGroupsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import PrivateDnsZoneGroupsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import PrivateDnsZoneGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import PrivateDnsZoneGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3845,6 +4277,8 @@ def private_endpoints(self): * 2019-12-01: :class:`PrivateEndpointsOperations` * 2020-03-01: :class:`PrivateEndpointsOperations` * 2020-04-01: :class:`PrivateEndpointsOperations` + * 2020-05-01: :class:`PrivateEndpointsOperations` + * 2020-06-01: :class:`PrivateEndpointsOperations` """ api_version = self._get_api_version('private_endpoints') if api_version == '2019-04-01': @@ -3865,6 +4299,10 @@ def private_endpoints(self): from .v2020_03_01.operations import PrivateEndpointsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import PrivateEndpointsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import PrivateEndpointsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import PrivateEndpointsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3882,6 +4320,8 @@ def private_link_services(self): * 2019-12-01: :class:`PrivateLinkServicesOperations` * 2020-03-01: :class:`PrivateLinkServicesOperations` * 2020-04-01: :class:`PrivateLinkServicesOperations` + * 2020-05-01: :class:`PrivateLinkServicesOperations` + * 2020-06-01: :class:`PrivateLinkServicesOperations` """ api_version = self._get_api_version('private_link_services') if api_version == '2019-04-01': @@ -3902,6 +4342,10 @@ def private_link_services(self): from .v2020_03_01.operations import PrivateLinkServicesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import PrivateLinkServicesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import PrivateLinkServicesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import PrivateLinkServicesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3938,6 +4382,8 @@ def public_ip_addresses(self): * 2019-12-01: :class:`PublicIPAddressesOperations` * 2020-03-01: :class:`PublicIPAddressesOperations` * 2020-04-01: :class:`PublicIPAddressesOperations` + * 2020-05-01: :class:`PublicIPAddressesOperations` + * 2020-06-01: :class:`PublicIPAddressesOperations` """ api_version = self._get_api_version('public_ip_addresses') if api_version == '2015-06-15': @@ -3996,6 +4442,10 @@ def public_ip_addresses(self): from .v2020_03_01.operations import PublicIPAddressesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import PublicIPAddressesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4019,6 +4469,8 @@ def public_ip_prefixes(self): * 2019-12-01: :class:`PublicIPPrefixesOperations` * 2020-03-01: :class:`PublicIPPrefixesOperations` * 2020-04-01: :class:`PublicIPPrefixesOperations` + * 2020-05-01: :class:`PublicIPPrefixesOperations` + * 2020-06-01: :class:`PublicIPPrefixesOperations` """ api_version = self._get_api_version('public_ip_prefixes') if api_version == '2018-07-01': @@ -4051,6 +4503,10 @@ def public_ip_prefixes(self): from .v2020_03_01.operations import PublicIPPrefixesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import PublicIPPrefixesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4069,6 +4525,8 @@ def resource_navigation_links(self): * 2019-12-01: :class:`ResourceNavigationLinksOperations` * 2020-03-01: :class:`ResourceNavigationLinksOperations` * 2020-04-01: :class:`ResourceNavigationLinksOperations` + * 2020-05-01: :class:`ResourceNavigationLinksOperations` + * 2020-06-01: :class:`ResourceNavigationLinksOperations` """ api_version = self._get_api_version('resource_navigation_links') if api_version == '2019-02-01': @@ -4091,6 +4549,10 @@ def resource_navigation_links(self): from .v2020_03_01.operations import ResourceNavigationLinksOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ResourceNavigationLinksOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ResourceNavigationLinksOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ResourceNavigationLinksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4125,6 +4587,8 @@ def route_filter_rules(self): * 2019-12-01: :class:`RouteFilterRulesOperations` * 2020-03-01: :class:`RouteFilterRulesOperations` * 2020-04-01: :class:`RouteFilterRulesOperations` + * 2020-05-01: :class:`RouteFilterRulesOperations` + * 2020-06-01: :class:`RouteFilterRulesOperations` """ api_version = self._get_api_version('route_filter_rules') if api_version == '2016-12-01': @@ -4179,6 +4643,10 @@ def route_filter_rules(self): from .v2020_03_01.operations import RouteFilterRulesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import RouteFilterRulesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4213,6 +4681,8 @@ def route_filters(self): * 2019-12-01: :class:`RouteFiltersOperations` * 2020-03-01: :class:`RouteFiltersOperations` * 2020-04-01: :class:`RouteFiltersOperations` + * 2020-05-01: :class:`RouteFiltersOperations` + * 2020-06-01: :class:`RouteFiltersOperations` """ api_version = self._get_api_version('route_filters') if api_version == '2016-12-01': @@ -4267,6 +4737,10 @@ def route_filters(self): from .v2020_03_01.operations import RouteFiltersOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import RouteFiltersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4303,6 +4777,8 @@ def route_tables(self): * 2019-12-01: :class:`RouteTablesOperations` * 2020-03-01: :class:`RouteTablesOperations` * 2020-04-01: :class:`RouteTablesOperations` + * 2020-05-01: :class:`RouteTablesOperations` + * 2020-06-01: :class:`RouteTablesOperations` """ api_version = self._get_api_version('route_tables') if api_version == '2015-06-15': @@ -4361,6 +4837,10 @@ def route_tables(self): from .v2020_03_01.operations import RouteTablesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import RouteTablesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4397,6 +4877,8 @@ def routes(self): * 2019-12-01: :class:`RoutesOperations` * 2020-03-01: :class:`RoutesOperations` * 2020-04-01: :class:`RoutesOperations` + * 2020-05-01: :class:`RoutesOperations` + * 2020-06-01: :class:`RoutesOperations` """ api_version = self._get_api_version('routes') if api_version == '2015-06-15': @@ -4455,6 +4937,10 @@ def routes(self): from .v2020_03_01.operations import RoutesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import RoutesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import RoutesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import RoutesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4465,12 +4951,18 @@ def security_partner_providers(self): * 2020-03-01: :class:`SecurityPartnerProvidersOperations` * 2020-04-01: :class:`SecurityPartnerProvidersOperations` + * 2020-05-01: :class:`SecurityPartnerProvidersOperations` + * 2020-06-01: :class:`SecurityPartnerProvidersOperations` """ api_version = self._get_api_version('security_partner_providers') if api_version == '2020-03-01': from .v2020_03_01.operations import SecurityPartnerProvidersOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import SecurityPartnerProvidersOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import SecurityPartnerProvidersOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import SecurityPartnerProvidersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4507,6 +4999,8 @@ def security_rules(self): * 2019-12-01: :class:`SecurityRulesOperations` * 2020-03-01: :class:`SecurityRulesOperations` * 2020-04-01: :class:`SecurityRulesOperations` + * 2020-05-01: :class:`SecurityRulesOperations` + * 2020-06-01: :class:`SecurityRulesOperations` """ api_version = self._get_api_version('security_rules') if api_version == '2015-06-15': @@ -4565,6 +5059,10 @@ def security_rules(self): from .v2020_03_01.operations import SecurityRulesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import SecurityRulesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4583,6 +5081,8 @@ def service_association_links(self): * 2019-12-01: :class:`ServiceAssociationLinksOperations` * 2020-03-01: :class:`ServiceAssociationLinksOperations` * 2020-04-01: :class:`ServiceAssociationLinksOperations` + * 2020-05-01: :class:`ServiceAssociationLinksOperations` + * 2020-06-01: :class:`ServiceAssociationLinksOperations` """ api_version = self._get_api_version('service_association_links') if api_version == '2019-02-01': @@ -4605,6 +5105,10 @@ def service_association_links(self): from .v2020_03_01.operations import ServiceAssociationLinksOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ServiceAssociationLinksOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ServiceAssociationLinksOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ServiceAssociationLinksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4628,6 +5132,8 @@ def service_endpoint_policies(self): * 2019-12-01: :class:`ServiceEndpointPoliciesOperations` * 2020-03-01: :class:`ServiceEndpointPoliciesOperations` * 2020-04-01: :class:`ServiceEndpointPoliciesOperations` + * 2020-05-01: :class:`ServiceEndpointPoliciesOperations` + * 2020-06-01: :class:`ServiceEndpointPoliciesOperations` """ api_version = self._get_api_version('service_endpoint_policies') if api_version == '2018-07-01': @@ -4660,6 +5166,10 @@ def service_endpoint_policies(self): from .v2020_03_01.operations import ServiceEndpointPoliciesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ServiceEndpointPoliciesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4683,6 +5193,8 @@ def service_endpoint_policy_definitions(self): * 2019-12-01: :class:`ServiceEndpointPolicyDefinitionsOperations` * 2020-03-01: :class:`ServiceEndpointPolicyDefinitionsOperations` * 2020-04-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2020-05-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2020-06-01: :class:`ServiceEndpointPolicyDefinitionsOperations` """ api_version = self._get_api_version('service_endpoint_policy_definitions') if api_version == '2018-07-01': @@ -4715,6 +5227,10 @@ def service_endpoint_policy_definitions(self): from .v2020_03_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4732,6 +5248,8 @@ def service_tags(self): * 2019-12-01: :class:`ServiceTagsOperations` * 2020-03-01: :class:`ServiceTagsOperations` * 2020-04-01: :class:`ServiceTagsOperations` + * 2020-05-01: :class:`ServiceTagsOperations` + * 2020-06-01: :class:`ServiceTagsOperations` """ api_version = self._get_api_version('service_tags') if api_version == '2019-04-01': @@ -4752,6 +5270,10 @@ def service_tags(self): from .v2020_03_01.operations import ServiceTagsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import ServiceTagsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import ServiceTagsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ServiceTagsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4788,6 +5310,8 @@ def subnets(self): * 2019-12-01: :class:`SubnetsOperations` * 2020-03-01: :class:`SubnetsOperations` * 2020-04-01: :class:`SubnetsOperations` + * 2020-05-01: :class:`SubnetsOperations` + * 2020-06-01: :class:`SubnetsOperations` """ api_version = self._get_api_version('subnets') if api_version == '2015-06-15': @@ -4846,6 +5370,10 @@ def subnets(self): from .v2020_03_01.operations import SubnetsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import SubnetsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import SubnetsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import SubnetsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4882,6 +5410,8 @@ def usages(self): * 2019-12-01: :class:`UsagesOperations` * 2020-03-01: :class:`UsagesOperations` * 2020-04-01: :class:`UsagesOperations` + * 2020-05-01: :class:`UsagesOperations` + * 2020-06-01: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2015-06-15': @@ -4940,6 +5470,90 @@ def usages(self): from .v2020_03_01.operations import UsagesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import UsagesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import UsagesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import UsagesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_appliance_sites(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualApplianceSitesOperations` + * 2020-06-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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_appliance_skus(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualApplianceSkusOperations` + * 2020-06-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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_hub_bgp_connection(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualHubBgpConnectionOperations` + * 2020-06-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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_hub_bgp_connections(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualHubBgpConnectionsOperations` + * 2020-06-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 + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_hub_ip_configuration(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualHubIpConfigurationOperations` + * 2020-06-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 else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4953,6 +5567,8 @@ def virtual_hub_route_table_v2_s(self): * 2019-12-01: :class:`VirtualHubRouteTableV2SOperations` * 2020-03-01: :class:`VirtualHubRouteTableV2SOperations` * 2020-04-01: :class:`VirtualHubRouteTableV2SOperations` + * 2020-05-01: :class:`VirtualHubRouteTableV2SOperations` + * 2020-06-01: :class:`VirtualHubRouteTableV2SOperations` """ api_version = self._get_api_version('virtual_hub_route_table_v2_s') if api_version == '2019-09-01': @@ -4965,6 +5581,10 @@ def virtual_hub_route_table_v2_s(self): from .v2020_03_01.operations import VirtualHubRouteTableV2SOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualHubRouteTableV2SOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualHubRouteTableV2SOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualHubRouteTableV2SOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4990,6 +5610,8 @@ def virtual_hubs(self): * 2019-12-01: :class:`VirtualHubsOperations` * 2020-03-01: :class:`VirtualHubsOperations` * 2020-04-01: :class:`VirtualHubsOperations` + * 2020-05-01: :class:`VirtualHubsOperations` + * 2020-06-01: :class:`VirtualHubsOperations` """ api_version = self._get_api_version('virtual_hubs') if api_version == '2018-04-01': @@ -5026,6 +5648,10 @@ def virtual_hubs(self): from .v2020_03_01.operations import VirtualHubsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualHubsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5062,6 +5688,8 @@ def virtual_network_gateway_connections(self): * 2019-12-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2020-03-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2020-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2020-05-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2020-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` """ api_version = self._get_api_version('virtual_network_gateway_connections') if api_version == '2015-06-15': @@ -5120,6 +5748,10 @@ def virtual_network_gateway_connections(self): from .v2020_03_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5156,6 +5788,8 @@ def virtual_network_gateways(self): * 2019-12-01: :class:`VirtualNetworkGatewaysOperations` * 2020-03-01: :class:`VirtualNetworkGatewaysOperations` * 2020-04-01: :class:`VirtualNetworkGatewaysOperations` + * 2020-05-01: :class:`VirtualNetworkGatewaysOperations` + * 2020-06-01: :class:`VirtualNetworkGatewaysOperations` """ api_version = self._get_api_version('virtual_network_gateways') if api_version == '2015-06-15': @@ -5214,6 +5848,10 @@ def virtual_network_gateways(self): from .v2020_03_01.operations import VirtualNetworkGatewaysOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5249,6 +5887,8 @@ def virtual_network_peerings(self): * 2019-12-01: :class:`VirtualNetworkPeeringsOperations` * 2020-03-01: :class:`VirtualNetworkPeeringsOperations` * 2020-04-01: :class:`VirtualNetworkPeeringsOperations` + * 2020-05-01: :class:`VirtualNetworkPeeringsOperations` + * 2020-06-01: :class:`VirtualNetworkPeeringsOperations` """ api_version = self._get_api_version('virtual_network_peerings') if api_version == '2016-09-01': @@ -5305,6 +5945,10 @@ def virtual_network_peerings(self): from .v2020_03_01.operations import VirtualNetworkPeeringsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5327,6 +5971,8 @@ def virtual_network_taps(self): * 2019-12-01: :class:`VirtualNetworkTapsOperations` * 2020-03-01: :class:`VirtualNetworkTapsOperations` * 2020-04-01: :class:`VirtualNetworkTapsOperations` + * 2020-05-01: :class:`VirtualNetworkTapsOperations` + * 2020-06-01: :class:`VirtualNetworkTapsOperations` """ api_version = self._get_api_version('virtual_network_taps') if api_version == '2018-08-01': @@ -5357,6 +6003,10 @@ def virtual_network_taps(self): from .v2020_03_01.operations import VirtualNetworkTapsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualNetworkTapsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5393,6 +6043,8 @@ def virtual_networks(self): * 2019-12-01: :class:`VirtualNetworksOperations` * 2020-03-01: :class:`VirtualNetworksOperations` * 2020-04-01: :class:`VirtualNetworksOperations` + * 2020-05-01: :class:`VirtualNetworksOperations` + * 2020-06-01: :class:`VirtualNetworksOperations` """ api_version = self._get_api_version('virtual_networks') if api_version == '2015-06-15': @@ -5451,6 +6103,10 @@ def virtual_networks(self): from .v2020_03_01.operations import VirtualNetworksOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualNetworksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5466,6 +6122,8 @@ def virtual_router_peerings(self): * 2019-12-01: :class:`VirtualRouterPeeringsOperations` * 2020-03-01: :class:`VirtualRouterPeeringsOperations` * 2020-04-01: :class:`VirtualRouterPeeringsOperations` + * 2020-05-01: :class:`VirtualRouterPeeringsOperations` + * 2020-06-01: :class:`VirtualRouterPeeringsOperations` """ api_version = self._get_api_version('virtual_router_peerings') if api_version == '2019-07-01': @@ -5482,6 +6140,10 @@ def virtual_router_peerings(self): from .v2020_03_01.operations import VirtualRouterPeeringsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualRouterPeeringsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualRouterPeeringsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualRouterPeeringsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5497,6 +6159,8 @@ def virtual_routers(self): * 2019-12-01: :class:`VirtualRoutersOperations` * 2020-03-01: :class:`VirtualRoutersOperations` * 2020-04-01: :class:`VirtualRoutersOperations` + * 2020-05-01: :class:`VirtualRoutersOperations` + * 2020-06-01: :class:`VirtualRoutersOperations` """ api_version = self._get_api_version('virtual_routers') if api_version == '2019-07-01': @@ -5513,6 +6177,10 @@ def virtual_routers(self): from .v2020_03_01.operations import VirtualRoutersOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualRoutersOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualRoutersOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualRoutersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5538,6 +6206,8 @@ def virtual_wans(self): * 2019-12-01: :class:`VirtualWansOperations` * 2020-03-01: :class:`VirtualWansOperations` * 2020-04-01: :class:`VirtualWansOperations` + * 2020-05-01: :class:`VirtualWansOperations` + * 2020-06-01: :class:`VirtualWansOperations` """ api_version = self._get_api_version('virtual_wans') if api_version == '2018-04-01': @@ -5574,6 +6244,10 @@ def virtual_wans(self): from .v2020_03_01.operations import VirtualWansOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VirtualWansOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VirtualWansOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualWansOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5599,6 +6273,8 @@ def vpn_connections(self): * 2019-12-01: :class:`VpnConnectionsOperations` * 2020-03-01: :class:`VpnConnectionsOperations` * 2020-04-01: :class:`VpnConnectionsOperations` + * 2020-05-01: :class:`VpnConnectionsOperations` + * 2020-06-01: :class:`VpnConnectionsOperations` """ api_version = self._get_api_version('vpn_connections') if api_version == '2018-04-01': @@ -5635,6 +6311,10 @@ def vpn_connections(self): from .v2020_03_01.operations import VpnConnectionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VpnConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5660,6 +6340,8 @@ def vpn_gateways(self): * 2019-12-01: :class:`VpnGatewaysOperations` * 2020-03-01: :class:`VpnGatewaysOperations` * 2020-04-01: :class:`VpnGatewaysOperations` + * 2020-05-01: :class:`VpnGatewaysOperations` + * 2020-06-01: :class:`VpnGatewaysOperations` """ api_version = self._get_api_version('vpn_gateways') if api_version == '2018-04-01': @@ -5696,6 +6378,10 @@ def vpn_gateways(self): from .v2020_03_01.operations import VpnGatewaysOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VpnGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5712,6 +6398,8 @@ def vpn_link_connections(self): * 2019-12-01: :class:`VpnLinkConnectionsOperations` * 2020-03-01: :class:`VpnLinkConnectionsOperations` * 2020-04-01: :class:`VpnLinkConnectionsOperations` + * 2020-05-01: :class:`VpnLinkConnectionsOperations` + * 2020-06-01: :class:`VpnLinkConnectionsOperations` """ api_version = self._get_api_version('vpn_link_connections') if api_version == '2019-06-01': @@ -5730,6 +6418,10 @@ def vpn_link_connections(self): from .v2020_03_01.operations import VpnLinkConnectionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VpnLinkConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VpnLinkConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VpnLinkConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5744,6 +6436,8 @@ def vpn_server_configurations(self): * 2019-12-01: :class:`VpnServerConfigurationsOperations` * 2020-03-01: :class:`VpnServerConfigurationsOperations` * 2020-04-01: :class:`VpnServerConfigurationsOperations` + * 2020-05-01: :class:`VpnServerConfigurationsOperations` + * 2020-06-01: :class:`VpnServerConfigurationsOperations` """ api_version = self._get_api_version('vpn_server_configurations') if api_version == '2019-08-01': @@ -5758,6 +6452,10 @@ def vpn_server_configurations(self): from .v2020_03_01.operations import VpnServerConfigurationsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VpnServerConfigurationsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VpnServerConfigurationsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VpnServerConfigurationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5772,6 +6470,8 @@ def vpn_server_configurations_associated_with_virtual_wan(self): * 2019-12-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` * 2020-03-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` * 2020-04-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` + * 2020-05-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` + * 2020-06-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` """ api_version = self._get_api_version('vpn_server_configurations_associated_with_virtual_wan') if api_version == '2019-08-01': @@ -5786,6 +6486,10 @@ def vpn_server_configurations_associated_with_virtual_wan(self): from .v2020_03_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5802,6 +6506,8 @@ def vpn_site_link_connections(self): * 2019-12-01: :class:`VpnSiteLinkConnectionsOperations` * 2020-03-01: :class:`VpnSiteLinkConnectionsOperations` * 2020-04-01: :class:`VpnSiteLinkConnectionsOperations` + * 2020-05-01: :class:`VpnSiteLinkConnectionsOperations` + * 2020-06-01: :class:`VpnSiteLinkConnectionsOperations` """ api_version = self._get_api_version('vpn_site_link_connections') if api_version == '2019-06-01': @@ -5820,6 +6526,10 @@ def vpn_site_link_connections(self): from .v2020_03_01.operations import VpnSiteLinkConnectionsOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VpnSiteLinkConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VpnSiteLinkConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VpnSiteLinkConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5836,6 +6546,8 @@ def vpn_site_links(self): * 2019-12-01: :class:`VpnSiteLinksOperations` * 2020-03-01: :class:`VpnSiteLinksOperations` * 2020-04-01: :class:`VpnSiteLinksOperations` + * 2020-05-01: :class:`VpnSiteLinksOperations` + * 2020-06-01: :class:`VpnSiteLinksOperations` """ api_version = self._get_api_version('vpn_site_links') if api_version == '2019-06-01': @@ -5854,6 +6566,10 @@ def vpn_site_links(self): from .v2020_03_01.operations import VpnSiteLinksOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VpnSiteLinksOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VpnSiteLinksOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VpnSiteLinksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5879,6 +6595,8 @@ def vpn_sites(self): * 2019-12-01: :class:`VpnSitesOperations` * 2020-03-01: :class:`VpnSitesOperations` * 2020-04-01: :class:`VpnSitesOperations` + * 2020-05-01: :class:`VpnSitesOperations` + * 2020-06-01: :class:`VpnSitesOperations` """ api_version = self._get_api_version('vpn_sites') if api_version == '2018-04-01': @@ -5915,6 +6633,10 @@ def vpn_sites(self): from .v2020_03_01.operations import VpnSitesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VpnSitesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5940,6 +6662,8 @@ def vpn_sites_configuration(self): * 2019-12-01: :class:`VpnSitesConfigurationOperations` * 2020-03-01: :class:`VpnSitesConfigurationOperations` * 2020-04-01: :class:`VpnSitesConfigurationOperations` + * 2020-05-01: :class:`VpnSitesConfigurationOperations` + * 2020-06-01: :class:`VpnSitesConfigurationOperations` """ api_version = self._get_api_version('vpn_sites_configuration') if api_version == '2018-04-01': @@ -5976,6 +6700,10 @@ def vpn_sites_configuration(self): from .v2020_03_01.operations import VpnSitesConfigurationOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import VpnSitesConfigurationOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5995,6 +6723,8 @@ def web_application_firewall_policies(self): * 2019-12-01: :class:`WebApplicationFirewallPoliciesOperations` * 2020-03-01: :class:`WebApplicationFirewallPoliciesOperations` * 2020-04-01: :class:`WebApplicationFirewallPoliciesOperations` + * 2020-05-01: :class:`WebApplicationFirewallPoliciesOperations` + * 2020-06-01: :class:`WebApplicationFirewallPoliciesOperations` """ api_version = self._get_api_version('web_application_firewall_policies') if api_version == '2018-12-01': @@ -6019,6 +6749,10 @@ def web_application_firewall_policies(self): from .v2020_03_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) 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 87376fab0f26..0981b1f228b7 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 @@ -27,72 +27,28 @@ class NetworkManagementClientOperationsMixin(object): - def check_dns_name_availability( + def begin_delete_bastion_shareable_link( self, - location, # type: str - domain_name_label, # type: str + resource_group_name, # type: str + bastion_host_name, # type: str + bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - """Checks whether a domain name in the cloudapp.azure.com zone is available for use. + """Deletes the Bastion Shareable Links for all the VMs specified in the request. - :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 + :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_06_01.models.BastionShareableLinkListRequest :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_04_01.models.DnsNameAvailabilityResult + :return: None, or the result of cls(response) + :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('check_dns_name_availability') - if api_version == '2015-06-15': - from .v2015_06_15.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-09-01': + api_version = self._get_api_version('begin_delete_bastion_shareable_link') + if api_version == '2019-09-01': from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': from .v2019_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass @@ -102,6 +58,10 @@ def check_dns_name_availability( from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -109,30 +69,35 @@ def check_dns_name_availability( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.check_dns_name_availability(location, domain_name_label, **kwargs) + return mixin_instance.begin_delete_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) - def begin_delete_bastion_shareable_link( + def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name, # type: str - bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + virtual_wan_name, # type: str + vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - """Deletes the Bastion Shareable Links for all the VMs specified in the request. + """Generates a unique VPN profile for P2S clients for VirtualWan and associated + VpnServerConfiguration combination in the specified resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The resource group name. :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_04_01.models.BastionShareableLinkListRequest + :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_06_01.models.VirtualWanVpnProfileParameters :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None + :return: VpnProfileResponse, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnProfileResponse :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('begin_delete_bastion_shareable_link') - if api_version == '2019-09-01': + api_version = self._get_api_version('begin_generatevirtualwanvpnserverconfigurationvpnprofile') + if api_version == '2019-08-01': + from .v2019_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-09-01': from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': from .v2019_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass @@ -142,6 +107,10 @@ def begin_delete_bastion_shareable_link( from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -149,13 +118,12 @@ def begin_delete_bastion_shareable_link( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_delete_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) + return mixin_instance.begin_generatevirtualwanvpnserverconfigurationvpnprofile(resource_group_name, virtual_wan_name, vpn_client_params, **kwargs) - def disconnect_active_sessions( + def begin_get_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - session_ids, # type: "models.SessionIds" **kwargs # type: Any ): """Returns the list of currently active sessions on the Bastion. @@ -164,14 +132,12 @@ def disconnect_active_sessions( :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_04_01.models.SessionIds :keyword callable cls: A custom type or function that will be passed the direct response - :return: BastionSessionDeleteResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionSessionDeleteResult + :return: BastionActiveSessionListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('disconnect_active_sessions') + api_version = self._get_api_version('begin_get_active_sessions') if api_version == '2019-09-01': from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': @@ -182,6 +148,10 @@ def disconnect_active_sessions( from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -189,35 +159,30 @@ def disconnect_active_sessions( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.disconnect_active_sessions(resource_group_name, bastion_host_name, session_ids, **kwargs) + return mixin_instance.begin_get_active_sessions(resource_group_name, bastion_host_name, **kwargs) - def begin_generatevirtualwanvpnserverconfigurationvpnprofile( + def begin_put_bastion_shareable_link( self, resource_group_name, # type: str - virtual_wan_name, # type: str - vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" + bastion_host_name, # type: str + bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - """Generates a unique VPN profile for P2S clients for VirtualWan and associated - VpnServerConfiguration combination in the specified resource group. + """Creates a Bastion Shareable Links for all the VMs specified in the request. - :param resource_group_name: The resource group name. + :param resource_group_name: The name of the resource group. :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_04_01.models.VirtualWanVpnProfileParameters + :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 :keyword callable cls: A custom type or function that will be passed the direct response - :return: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse or None + :return: BastionShareableLinkListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('begin_generatevirtualwanvpnserverconfigurationvpnprofile') - if api_version == '2019-08-01': - from .v2019_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-09-01': + api_version = self._get_api_version('begin_put_bastion_shareable_link') + if api_version == '2019-09-01': from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': from .v2019_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass @@ -227,6 +192,10 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -234,27 +203,74 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_generatevirtualwanvpnserverconfigurationvpnprofile(resource_group_name, virtual_wan_name, vpn_client_params, **kwargs) + return mixin_instance.begin_put_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) - def begin_get_active_sessions( + def check_dns_name_availability( self, - resource_group_name, # type: str - bastion_host_name, # type: str + location, # type: str + domain_name_label, # type: str **kwargs # type: Any ): - """Returns the list of currently active sessions on the Bastion. + """Checks whether a domain name in the cloudapp.azure.com zone is available for use. - :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 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: BastionActiveSessionListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionActiveSessionListResult or None + :return: DnsNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('begin_get_active_sessions') - if api_version == '2019-09-01': + api_version = self._get_api_version('check_dns_name_availability') + if api_version == '2015-06-15': + from .v2015_06_15.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-07-01': + from .v2019_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-08-01': + from .v2019_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-09-01': from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': from .v2019_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass @@ -264,6 +280,10 @@ def begin_get_active_sessions( from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -271,29 +291,29 @@ def begin_get_active_sessions( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_get_active_sessions(resource_group_name, bastion_host_name, **kwargs) + return mixin_instance.check_dns_name_availability(location, domain_name_label, **kwargs) - def get_bastion_shareable_link( + def disconnect_active_sessions( self, resource_group_name, # type: str bastion_host_name, # type: str - bsl_request, # type: "models.BastionShareableLinkListRequest" + session_ids, # type: "models.SessionIds" **kwargs # type: Any ): - """Return the Bastion Shareable Links for all the VMs specified in the request. + """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 bsl_request: Post request for all the Bastion Shareable Link endpoints. - :type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest + :param session_ids: The list of sessionids to disconnect. + :type session_ids: ~azure.mgmt.network.v2020_06_01.models.SessionIds :keyword callable cls: A custom type or function that will be passed the direct response - :return: BastionShareableLinkListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult + :return: BastionSessionDeleteResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionSessionDeleteResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('get_bastion_shareable_link') + api_version = self._get_api_version('disconnect_active_sessions') if api_version == '2019-09-01': from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': @@ -304,6 +324,10 @@ def get_bastion_shareable_link( from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -311,29 +335,29 @@ def get_bastion_shareable_link( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.get_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) + return mixin_instance.disconnect_active_sessions(resource_group_name, bastion_host_name, session_ids, **kwargs) - def begin_put_bastion_shareable_link( + def get_bastion_shareable_link( self, resource_group_name, # type: str bastion_host_name, # type: str bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - """Creates a Bastion Shareable Links for all the VMs specified in the request. + """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_04_01.models.BastionShareableLinkListRequest + :type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: BastionShareableLinkListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult or None + :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('begin_put_bastion_shareable_link') + api_version = self._get_api_version('get_bastion_shareable_link') if api_version == '2019-09-01': from .v2019_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': @@ -344,6 +368,10 @@ def begin_put_bastion_shareable_link( from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -351,7 +379,7 @@ def begin_put_bastion_shareable_link( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_put_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) + return mixin_instance.get_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) def supported_security_providers( self, @@ -368,7 +396,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_04_01.models.VirtualWanSecurityProviders + :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('supported_security_providers') @@ -400,6 +428,10 @@ def supported_security_providers( from .v2020_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from .v2020_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from .v2020_05_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_network_management_client_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_network_management_client_async.py index df3cc0b747f7..b3a42041bd17 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_network_management_client_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_network_management_client_async.py @@ -46,11 +46,12 @@ 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-04-01' + DEFAULT_API_VERSION = '2020-06-01' _PROFILE_TAG = "azure.mgmt.network.NetworkManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, + 'firewall_policy_rule_groups': '2020-04-01', 'interface_endpoints': '2019-02-01', 'p2_svpn_server_configurations': '2019-07-01', }}, @@ -113,6 +114,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-12-01: :mod:`v2019_12_01.models` * 2020-03-01: :mod:`v2020_03_01.models` * 2020-04-01: :mod:`v2020_04_01.models` + * 2020-05-01: :mod:`v2020_05_01.models` + * 2020-06-01: :mod:`v2020_06_01.models` """ if api_version == '2015-06-15': from ..v2015_06_15 import models @@ -198,8 +201,46 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-04-01': from ..v2020_04_01 import models return models + elif api_version == '2020-05-01': + from ..v2020_05_01 import models + return models + elif api_version == '2020-06-01': + from ..v2020_06_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + @property + def application_gateway_private_endpoint_connections(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` + * 2020-06-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_async import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def application_gateway_private_link_resources(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` + * 2020-06-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_async import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def application_gateways(self): """Instance depends on the API version: @@ -232,6 +273,8 @@ def application_gateways(self): * 2019-12-01: :class:`ApplicationGatewaysOperations` * 2020-03-01: :class:`ApplicationGatewaysOperations` * 2020-04-01: :class:`ApplicationGatewaysOperations` + * 2020-05-01: :class:`ApplicationGatewaysOperations` + * 2020-06-01: :class:`ApplicationGatewaysOperations` """ api_version = self._get_api_version('application_gateways') if api_version == '2015-06-15': @@ -290,6 +333,10 @@ def application_gateways(self): from ..v2020_03_01.aio.operations_async import ApplicationGatewaysOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ApplicationGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ApplicationGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ApplicationGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -320,6 +367,8 @@ def application_security_groups(self): * 2019-12-01: :class:`ApplicationSecurityGroupsOperations` * 2020-03-01: :class:`ApplicationSecurityGroupsOperations` * 2020-04-01: :class:`ApplicationSecurityGroupsOperations` + * 2020-05-01: :class:`ApplicationSecurityGroupsOperations` + * 2020-06-01: :class:`ApplicationSecurityGroupsOperations` """ api_version = self._get_api_version('application_security_groups') if api_version == '2017-09-01': @@ -366,6 +415,10 @@ def application_security_groups(self): from ..v2020_03_01.aio.operations_async import ApplicationSecurityGroupsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ApplicationSecurityGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -388,6 +441,8 @@ def available_delegations(self): * 2019-12-01: :class:`AvailableDelegationsOperations` * 2020-03-01: :class:`AvailableDelegationsOperations` * 2020-04-01: :class:`AvailableDelegationsOperations` + * 2020-05-01: :class:`AvailableDelegationsOperations` + * 2020-06-01: :class:`AvailableDelegationsOperations` """ api_version = self._get_api_version('available_delegations') if api_version == '2018-08-01': @@ -418,6 +473,10 @@ def available_delegations(self): from ..v2020_03_01.aio.operations_async import AvailableDelegationsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import AvailableDelegationsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import AvailableDelegationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import AvailableDelegationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -450,6 +509,8 @@ def available_endpoint_services(self): * 2019-12-01: :class:`AvailableEndpointServicesOperations` * 2020-03-01: :class:`AvailableEndpointServicesOperations` * 2020-04-01: :class:`AvailableEndpointServicesOperations` + * 2020-05-01: :class:`AvailableEndpointServicesOperations` + * 2020-06-01: :class:`AvailableEndpointServicesOperations` """ api_version = self._get_api_version('available_endpoint_services') if api_version == '2017-06-01': @@ -500,6 +561,10 @@ def available_endpoint_services(self): from ..v2020_03_01.aio.operations_async import AvailableEndpointServicesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import AvailableEndpointServicesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -517,6 +582,8 @@ def available_private_endpoint_types(self): * 2019-12-01: :class:`AvailablePrivateEndpointTypesOperations` * 2020-03-01: :class:`AvailablePrivateEndpointTypesOperations` * 2020-04-01: :class:`AvailablePrivateEndpointTypesOperations` + * 2020-05-01: :class:`AvailablePrivateEndpointTypesOperations` + * 2020-06-01: :class:`AvailablePrivateEndpointTypesOperations` """ api_version = self._get_api_version('available_private_endpoint_types') if api_version == '2019-04-01': @@ -537,6 +604,10 @@ def available_private_endpoint_types(self): from ..v2020_03_01.aio.operations_async import AvailablePrivateEndpointTypesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import AvailablePrivateEndpointTypesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import AvailablePrivateEndpointTypesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import AvailablePrivateEndpointTypesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -559,6 +630,8 @@ def available_resource_group_delegations(self): * 2019-12-01: :class:`AvailableResourceGroupDelegationsOperations` * 2020-03-01: :class:`AvailableResourceGroupDelegationsOperations` * 2020-04-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2020-05-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2020-06-01: :class:`AvailableResourceGroupDelegationsOperations` """ api_version = self._get_api_version('available_resource_group_delegations') if api_version == '2018-08-01': @@ -589,6 +662,10 @@ def available_resource_group_delegations(self): from ..v2020_03_01.aio.operations_async import AvailableResourceGroupDelegationsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import AvailableResourceGroupDelegationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -603,6 +680,8 @@ def available_service_aliases(self): * 2019-12-01: :class:`AvailableServiceAliasesOperations` * 2020-03-01: :class:`AvailableServiceAliasesOperations` * 2020-04-01: :class:`AvailableServiceAliasesOperations` + * 2020-05-01: :class:`AvailableServiceAliasesOperations` + * 2020-06-01: :class:`AvailableServiceAliasesOperations` """ api_version = self._get_api_version('available_service_aliases') if api_version == '2019-08-01': @@ -617,6 +696,10 @@ def available_service_aliases(self): from ..v2020_03_01.aio.operations_async import AvailableServiceAliasesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import AvailableServiceAliasesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import AvailableServiceAliasesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import AvailableServiceAliasesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -639,6 +722,8 @@ def azure_firewall_fqdn_tags(self): * 2019-12-01: :class:`AzureFirewallFqdnTagsOperations` * 2020-03-01: :class:`AzureFirewallFqdnTagsOperations` * 2020-04-01: :class:`AzureFirewallFqdnTagsOperations` + * 2020-05-01: :class:`AzureFirewallFqdnTagsOperations` + * 2020-06-01: :class:`AzureFirewallFqdnTagsOperations` """ api_version = self._get_api_version('azure_firewall_fqdn_tags') if api_version == '2018-08-01': @@ -669,6 +754,10 @@ def azure_firewall_fqdn_tags(self): from ..v2020_03_01.aio.operations_async import AzureFirewallFqdnTagsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import AzureFirewallFqdnTagsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -694,6 +783,8 @@ def azure_firewalls(self): * 2019-12-01: :class:`AzureFirewallsOperations` * 2020-03-01: :class:`AzureFirewallsOperations` * 2020-04-01: :class:`AzureFirewallsOperations` + * 2020-05-01: :class:`AzureFirewallsOperations` + * 2020-06-01: :class:`AzureFirewallsOperations` """ api_version = self._get_api_version('azure_firewalls') if api_version == '2018-04-01': @@ -730,6 +821,10 @@ def azure_firewalls(self): from ..v2020_03_01.aio.operations_async import AzureFirewallsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import AzureFirewallsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import AzureFirewallsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import AzureFirewallsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -747,6 +842,8 @@ def bastion_hosts(self): * 2019-12-01: :class:`BastionHostsOperations` * 2020-03-01: :class:`BastionHostsOperations` * 2020-04-01: :class:`BastionHostsOperations` + * 2020-05-01: :class:`BastionHostsOperations` + * 2020-06-01: :class:`BastionHostsOperations` """ api_version = self._get_api_version('bastion_hosts') if api_version == '2019-04-01': @@ -767,6 +864,10 @@ def bastion_hosts(self): from ..v2020_03_01.aio.operations_async import BastionHostsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import BastionHostsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import BastionHostsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import BastionHostsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -801,6 +902,8 @@ def bgp_service_communities(self): * 2019-12-01: :class:`BgpServiceCommunitiesOperations` * 2020-03-01: :class:`BgpServiceCommunitiesOperations` * 2020-04-01: :class:`BgpServiceCommunitiesOperations` + * 2020-05-01: :class:`BgpServiceCommunitiesOperations` + * 2020-06-01: :class:`BgpServiceCommunitiesOperations` """ api_version = self._get_api_version('bgp_service_communities') if api_version == '2016-12-01': @@ -855,6 +958,10 @@ def bgp_service_communities(self): from ..v2020_03_01.aio.operations_async import BgpServiceCommunitiesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import BgpServiceCommunitiesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -884,6 +991,8 @@ def connection_monitors(self): * 2019-12-01: :class:`ConnectionMonitorsOperations` * 2020-03-01: :class:`ConnectionMonitorsOperations` * 2020-04-01: :class:`ConnectionMonitorsOperations` + * 2020-05-01: :class:`ConnectionMonitorsOperations` + * 2020-06-01: :class:`ConnectionMonitorsOperations` """ api_version = self._get_api_version('connection_monitors') if api_version == '2017-10-01': @@ -928,6 +1037,23 @@ def connection_monitors(self): from ..v2020_03_01.aio.operations_async import ConnectionMonitorsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ConnectionMonitorsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ConnectionMonitorsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ConnectionMonitorsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def custom_ip_prefixes(self): + """Instance depends on the API version: + + * 2020-06-01: :class:`CustomIPPrefixesOperations` + """ + api_version = self._get_api_version('custom_ip_prefixes') + if api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import CustomIPPrefixesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -948,6 +1074,8 @@ def ddos_custom_policies(self): * 2019-12-01: :class:`DdosCustomPoliciesOperations` * 2020-03-01: :class:`DdosCustomPoliciesOperations` * 2020-04-01: :class:`DdosCustomPoliciesOperations` + * 2020-05-01: :class:`DdosCustomPoliciesOperations` + * 2020-06-01: :class:`DdosCustomPoliciesOperations` """ api_version = self._get_api_version('ddos_custom_policies') if api_version == '2018-11-01': @@ -974,6 +1102,10 @@ def ddos_custom_policies(self): from ..v2020_03_01.aio.operations_async import DdosCustomPoliciesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import DdosCustomPoliciesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import DdosCustomPoliciesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import DdosCustomPoliciesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1000,6 +1132,8 @@ def ddos_protection_plans(self): * 2019-12-01: :class:`DdosProtectionPlansOperations` * 2020-03-01: :class:`DdosProtectionPlansOperations` * 2020-04-01: :class:`DdosProtectionPlansOperations` + * 2020-05-01: :class:`DdosProtectionPlansOperations` + * 2020-06-01: :class:`DdosProtectionPlansOperations` """ api_version = self._get_api_version('ddos_protection_plans') if api_version == '2018-02-01': @@ -1038,6 +1172,10 @@ def ddos_protection_plans(self): from ..v2020_03_01.aio.operations_async import DdosProtectionPlansOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import DdosProtectionPlansOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import DdosProtectionPlansOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import DdosProtectionPlansOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1070,6 +1208,8 @@ def default_security_rules(self): * 2019-12-01: :class:`DefaultSecurityRulesOperations` * 2020-03-01: :class:`DefaultSecurityRulesOperations` * 2020-04-01: :class:`DefaultSecurityRulesOperations` + * 2020-05-01: :class:`DefaultSecurityRulesOperations` + * 2020-06-01: :class:`DefaultSecurityRulesOperations` """ api_version = self._get_api_version('default_security_rules') if api_version == '2017-06-01': @@ -1120,6 +1260,23 @@ def default_security_rules(self): from ..v2020_03_01.aio.operations_async import DefaultSecurityRulesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import DefaultSecurityRulesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def dscp_configuration(self): + """Instance depends on the API version: + + * 2020-06-01: :class:`DscpConfigurationOperations` + """ + api_version = self._get_api_version('dscp_configuration') + if api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import DscpConfigurationOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1156,6 +1313,8 @@ def express_route_circuit_authorizations(self): * 2019-12-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2020-03-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2020-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2020-05-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2020-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` """ api_version = self._get_api_version('express_route_circuit_authorizations') if api_version == '2015-06-15': @@ -1214,6 +1373,10 @@ def express_route_circuit_authorizations(self): from ..v2020_03_01.aio.operations_async import ExpressRouteCircuitAuthorizationsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteCircuitAuthorizationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1240,6 +1403,8 @@ def express_route_circuit_connections(self): * 2019-12-01: :class:`ExpressRouteCircuitConnectionsOperations` * 2020-03-01: :class:`ExpressRouteCircuitConnectionsOperations` * 2020-04-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2020-05-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2020-06-01: :class:`ExpressRouteCircuitConnectionsOperations` """ api_version = self._get_api_version('express_route_circuit_connections') if api_version == '2018-02-01': @@ -1278,6 +1443,10 @@ def express_route_circuit_connections(self): from ..v2020_03_01.aio.operations_async import ExpressRouteCircuitConnectionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteCircuitConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1314,6 +1483,8 @@ def express_route_circuit_peerings(self): * 2019-12-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2020-03-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2020-04-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2020-05-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2020-06-01: :class:`ExpressRouteCircuitPeeringsOperations` """ api_version = self._get_api_version('express_route_circuit_peerings') if api_version == '2015-06-15': @@ -1372,6 +1543,10 @@ def express_route_circuit_peerings(self): from ..v2020_03_01.aio.operations_async import ExpressRouteCircuitPeeringsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteCircuitPeeringsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1408,6 +1583,8 @@ def express_route_circuits(self): * 2019-12-01: :class:`ExpressRouteCircuitsOperations` * 2020-03-01: :class:`ExpressRouteCircuitsOperations` * 2020-04-01: :class:`ExpressRouteCircuitsOperations` + * 2020-05-01: :class:`ExpressRouteCircuitsOperations` + * 2020-06-01: :class:`ExpressRouteCircuitsOperations` """ api_version = self._get_api_version('express_route_circuits') if api_version == '2015-06-15': @@ -1466,6 +1643,10 @@ def express_route_circuits(self): from ..v2020_03_01.aio.operations_async import ExpressRouteCircuitsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteCircuitsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1488,6 +1669,8 @@ def express_route_connections(self): * 2019-12-01: :class:`ExpressRouteConnectionsOperations` * 2020-03-01: :class:`ExpressRouteConnectionsOperations` * 2020-04-01: :class:`ExpressRouteConnectionsOperations` + * 2020-05-01: :class:`ExpressRouteConnectionsOperations` + * 2020-06-01: :class:`ExpressRouteConnectionsOperations` """ api_version = self._get_api_version('express_route_connections') if api_version == '2018-08-01': @@ -1518,6 +1701,10 @@ def express_route_connections(self): from ..v2020_03_01.aio.operations_async import ExpressRouteConnectionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1544,6 +1731,8 @@ def express_route_cross_connection_peerings(self): * 2019-12-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` * 2020-03-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` * 2020-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2020-05-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2020-06-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` """ api_version = self._get_api_version('express_route_cross_connection_peerings') if api_version == '2018-02-01': @@ -1582,6 +1771,10 @@ def express_route_cross_connection_peerings(self): from ..v2020_03_01.aio.operations_async import ExpressRouteCrossConnectionPeeringsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteCrossConnectionPeeringsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1608,6 +1801,8 @@ def express_route_cross_connections(self): * 2019-12-01: :class:`ExpressRouteCrossConnectionsOperations` * 2020-03-01: :class:`ExpressRouteCrossConnectionsOperations` * 2020-04-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2020-05-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2020-06-01: :class:`ExpressRouteCrossConnectionsOperations` """ api_version = self._get_api_version('express_route_cross_connections') if api_version == '2018-02-01': @@ -1646,6 +1841,10 @@ def express_route_cross_connections(self): from ..v2020_03_01.aio.operations_async import ExpressRouteCrossConnectionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteCrossConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1668,6 +1867,8 @@ def express_route_gateways(self): * 2019-12-01: :class:`ExpressRouteGatewaysOperations` * 2020-03-01: :class:`ExpressRouteGatewaysOperations` * 2020-04-01: :class:`ExpressRouteGatewaysOperations` + * 2020-05-01: :class:`ExpressRouteGatewaysOperations` + * 2020-06-01: :class:`ExpressRouteGatewaysOperations` """ api_version = self._get_api_version('express_route_gateways') if api_version == '2018-08-01': @@ -1698,6 +1899,10 @@ def express_route_gateways(self): from ..v2020_03_01.aio.operations_async import ExpressRouteGatewaysOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1720,6 +1925,8 @@ def express_route_links(self): * 2019-12-01: :class:`ExpressRouteLinksOperations` * 2020-03-01: :class:`ExpressRouteLinksOperations` * 2020-04-01: :class:`ExpressRouteLinksOperations` + * 2020-05-01: :class:`ExpressRouteLinksOperations` + * 2020-06-01: :class:`ExpressRouteLinksOperations` """ api_version = self._get_api_version('express_route_links') if api_version == '2018-08-01': @@ -1750,6 +1957,10 @@ def express_route_links(self): from ..v2020_03_01.aio.operations_async import ExpressRouteLinksOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteLinksOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteLinksOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteLinksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1772,6 +1983,8 @@ def express_route_ports(self): * 2019-12-01: :class:`ExpressRoutePortsOperations` * 2020-03-01: :class:`ExpressRoutePortsOperations` * 2020-04-01: :class:`ExpressRoutePortsOperations` + * 2020-05-01: :class:`ExpressRoutePortsOperations` + * 2020-06-01: :class:`ExpressRoutePortsOperations` """ api_version = self._get_api_version('express_route_ports') if api_version == '2018-08-01': @@ -1802,6 +2015,10 @@ def express_route_ports(self): from ..v2020_03_01.aio.operations_async import ExpressRoutePortsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRoutePortsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRoutePortsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRoutePortsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1824,6 +2041,8 @@ def express_route_ports_locations(self): * 2019-12-01: :class:`ExpressRoutePortsLocationsOperations` * 2020-03-01: :class:`ExpressRoutePortsLocationsOperations` * 2020-04-01: :class:`ExpressRoutePortsLocationsOperations` + * 2020-05-01: :class:`ExpressRoutePortsLocationsOperations` + * 2020-06-01: :class:`ExpressRoutePortsLocationsOperations` """ api_version = self._get_api_version('express_route_ports_locations') if api_version == '2018-08-01': @@ -1854,6 +2073,10 @@ def express_route_ports_locations(self): from ..v2020_03_01.aio.operations_async import ExpressRoutePortsLocationsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRoutePortsLocationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1890,6 +2113,8 @@ def express_route_service_providers(self): * 2019-12-01: :class:`ExpressRouteServiceProvidersOperations` * 2020-03-01: :class:`ExpressRouteServiceProvidersOperations` * 2020-04-01: :class:`ExpressRouteServiceProvidersOperations` + * 2020-05-01: :class:`ExpressRouteServiceProvidersOperations` + * 2020-06-01: :class:`ExpressRouteServiceProvidersOperations` """ api_version = self._get_api_version('express_route_service_providers') if api_version == '2015-06-15': @@ -1948,6 +2173,10 @@ def express_route_service_providers(self): from ..v2020_03_01.aio.operations_async import ExpressRouteServiceProvidersOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ExpressRouteServiceProvidersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1964,6 +2193,8 @@ def firewall_policies(self): * 2019-12-01: :class:`FirewallPoliciesOperations` * 2020-03-01: :class:`FirewallPoliciesOperations` * 2020-04-01: :class:`FirewallPoliciesOperations` + * 2020-05-01: :class:`FirewallPoliciesOperations` + * 2020-06-01: :class:`FirewallPoliciesOperations` """ api_version = self._get_api_version('firewall_policies') if api_version == '2019-06-01': @@ -1982,6 +2213,26 @@ def firewall_policies(self): from ..v2020_03_01.aio.operations_async import FirewallPoliciesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import FirewallPoliciesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import FirewallPoliciesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import FirewallPoliciesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def firewall_policy_rule_collection_groups(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` + * 2020-06-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_async import FirewallPolicyRuleCollectionGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import FirewallPolicyRuleCollectionGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2028,6 +2279,8 @@ def flow_logs(self): * 2019-12-01: :class:`FlowLogsOperations` * 2020-03-01: :class:`FlowLogsOperations` * 2020-04-01: :class:`FlowLogsOperations` + * 2020-05-01: :class:`FlowLogsOperations` + * 2020-06-01: :class:`FlowLogsOperations` """ api_version = self._get_api_version('flow_logs') if api_version == '2019-11-01': @@ -2038,6 +2291,10 @@ def flow_logs(self): from ..v2020_03_01.aio.operations_async import FlowLogsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import FlowLogsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import FlowLogsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import FlowLogsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2047,10 +2304,16 @@ def hub_route_tables(self): """Instance depends on the API version: * 2020-04-01: :class:`HubRouteTablesOperations` + * 2020-05-01: :class:`HubRouteTablesOperations` + * 2020-06-01: :class:`HubRouteTablesOperations` """ api_version = self._get_api_version('hub_route_tables') if api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import HubRouteTablesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import HubRouteTablesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import HubRouteTablesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2076,6 +2339,8 @@ def hub_virtual_network_connections(self): * 2019-12-01: :class:`HubVirtualNetworkConnectionsOperations` * 2020-03-01: :class:`HubVirtualNetworkConnectionsOperations` * 2020-04-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2020-05-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2020-06-01: :class:`HubVirtualNetworkConnectionsOperations` """ api_version = self._get_api_version('hub_virtual_network_connections') if api_version == '2018-04-01': @@ -2112,6 +2377,10 @@ def hub_virtual_network_connections(self): from ..v2020_03_01.aio.operations_async import HubVirtualNetworkConnectionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import HubVirtualNetworkConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2144,6 +2413,8 @@ def inbound_nat_rules(self): * 2019-12-01: :class:`InboundNatRulesOperations` * 2020-03-01: :class:`InboundNatRulesOperations` * 2020-04-01: :class:`InboundNatRulesOperations` + * 2020-05-01: :class:`InboundNatRulesOperations` + * 2020-06-01: :class:`InboundNatRulesOperations` """ api_version = self._get_api_version('inbound_nat_rules') if api_version == '2017-06-01': @@ -2194,6 +2465,23 @@ def inbound_nat_rules(self): from ..v2020_03_01.aio.operations_async import InboundNatRulesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import InboundNatRulesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import InboundNatRulesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import InboundNatRulesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def inbound_security_rule(self): + """Instance depends on the API version: + + * 2020-06-01: :class:`InboundSecurityRuleOperations` + """ + api_version = self._get_api_version('inbound_security_rule') + if api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import InboundSecurityRuleOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2229,12 +2517,18 @@ def ip_allocations(self): * 2020-03-01: :class:`IpAllocationsOperations` * 2020-04-01: :class:`IpAllocationsOperations` + * 2020-05-01: :class:`IpAllocationsOperations` + * 2020-06-01: :class:`IpAllocationsOperations` """ api_version = self._get_api_version('ip_allocations') if api_version == '2020-03-01': from ..v2020_03_01.aio.operations_async import IpAllocationsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import IpAllocationsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import IpAllocationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import IpAllocationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2248,6 +2542,8 @@ def ip_groups(self): * 2019-12-01: :class:`IpGroupsOperations` * 2020-03-01: :class:`IpGroupsOperations` * 2020-04-01: :class:`IpGroupsOperations` + * 2020-05-01: :class:`IpGroupsOperations` + * 2020-06-01: :class:`IpGroupsOperations` """ api_version = self._get_api_version('ip_groups') if api_version == '2019-09-01': @@ -2260,6 +2556,10 @@ def ip_groups(self): from ..v2020_03_01.aio.operations_async import IpGroupsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import IpGroupsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import IpGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import IpGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2292,6 +2592,8 @@ def load_balancer_backend_address_pools(self): * 2019-12-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2020-03-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2020-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2020-05-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2020-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` """ api_version = self._get_api_version('load_balancer_backend_address_pools') if api_version == '2017-06-01': @@ -2342,6 +2644,10 @@ def load_balancer_backend_address_pools(self): from ..v2020_03_01.aio.operations_async import LoadBalancerBackendAddressPoolsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import LoadBalancerBackendAddressPoolsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2374,6 +2680,8 @@ def load_balancer_frontend_ip_configurations(self): * 2019-12-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2020-03-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2020-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2020-05-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2020-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` """ api_version = self._get_api_version('load_balancer_frontend_ip_configurations') if api_version == '2017-06-01': @@ -2424,6 +2732,10 @@ def load_balancer_frontend_ip_configurations(self): from ..v2020_03_01.aio.operations_async import LoadBalancerFrontendIPConfigurationsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import LoadBalancerFrontendIPConfigurationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2456,6 +2768,8 @@ def load_balancer_load_balancing_rules(self): * 2019-12-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2020-03-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2020-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2020-05-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2020-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` """ api_version = self._get_api_version('load_balancer_load_balancing_rules') if api_version == '2017-06-01': @@ -2506,6 +2820,10 @@ def load_balancer_load_balancing_rules(self): from ..v2020_03_01.aio.operations_async import LoadBalancerLoadBalancingRulesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import LoadBalancerLoadBalancingRulesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2538,6 +2856,8 @@ def load_balancer_network_interfaces(self): * 2019-12-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2020-03-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2020-04-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2020-05-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2020-06-01: :class:`LoadBalancerNetworkInterfacesOperations` """ api_version = self._get_api_version('load_balancer_network_interfaces') if api_version == '2017-06-01': @@ -2588,6 +2908,10 @@ def load_balancer_network_interfaces(self): from ..v2020_03_01.aio.operations_async import LoadBalancerNetworkInterfacesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import LoadBalancerNetworkInterfacesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2610,6 +2934,8 @@ def load_balancer_outbound_rules(self): * 2019-12-01: :class:`LoadBalancerOutboundRulesOperations` * 2020-03-01: :class:`LoadBalancerOutboundRulesOperations` * 2020-04-01: :class:`LoadBalancerOutboundRulesOperations` + * 2020-05-01: :class:`LoadBalancerOutboundRulesOperations` + * 2020-06-01: :class:`LoadBalancerOutboundRulesOperations` """ api_version = self._get_api_version('load_balancer_outbound_rules') if api_version == '2018-08-01': @@ -2640,6 +2966,10 @@ def load_balancer_outbound_rules(self): from ..v2020_03_01.aio.operations_async import LoadBalancerOutboundRulesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import LoadBalancerOutboundRulesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2672,6 +3002,8 @@ def load_balancer_probes(self): * 2019-12-01: :class:`LoadBalancerProbesOperations` * 2020-03-01: :class:`LoadBalancerProbesOperations` * 2020-04-01: :class:`LoadBalancerProbesOperations` + * 2020-05-01: :class:`LoadBalancerProbesOperations` + * 2020-06-01: :class:`LoadBalancerProbesOperations` """ api_version = self._get_api_version('load_balancer_probes') if api_version == '2017-06-01': @@ -2722,6 +3054,10 @@ def load_balancer_probes(self): from ..v2020_03_01.aio.operations_async import LoadBalancerProbesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import LoadBalancerProbesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import LoadBalancerProbesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import LoadBalancerProbesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2758,6 +3094,8 @@ def load_balancers(self): * 2019-12-01: :class:`LoadBalancersOperations` * 2020-03-01: :class:`LoadBalancersOperations` * 2020-04-01: :class:`LoadBalancersOperations` + * 2020-05-01: :class:`LoadBalancersOperations` + * 2020-06-01: :class:`LoadBalancersOperations` """ api_version = self._get_api_version('load_balancers') if api_version == '2015-06-15': @@ -2816,6 +3154,10 @@ def load_balancers(self): from ..v2020_03_01.aio.operations_async import LoadBalancersOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import LoadBalancersOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import LoadBalancersOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import LoadBalancersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2852,6 +3194,8 @@ def local_network_gateways(self): * 2019-12-01: :class:`LocalNetworkGatewaysOperations` * 2020-03-01: :class:`LocalNetworkGatewaysOperations` * 2020-04-01: :class:`LocalNetworkGatewaysOperations` + * 2020-05-01: :class:`LocalNetworkGatewaysOperations` + * 2020-06-01: :class:`LocalNetworkGatewaysOperations` """ api_version = self._get_api_version('local_network_gateways') if api_version == '2015-06-15': @@ -2910,6 +3254,10 @@ def local_network_gateways(self): from ..v2020_03_01.aio.operations_async import LocalNetworkGatewaysOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import LocalNetworkGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2928,6 +3276,8 @@ def nat_gateways(self): * 2019-12-01: :class:`NatGatewaysOperations` * 2020-03-01: :class:`NatGatewaysOperations` * 2020-04-01: :class:`NatGatewaysOperations` + * 2020-05-01: :class:`NatGatewaysOperations` + * 2020-06-01: :class:`NatGatewaysOperations` """ api_version = self._get_api_version('nat_gateways') if api_version == '2019-02-01': @@ -2950,6 +3300,10 @@ def nat_gateways(self): from ..v2020_03_01.aio.operations_async import NatGatewaysOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NatGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NatGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NatGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -2982,6 +3336,8 @@ def network_interface_ip_configurations(self): * 2019-12-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2020-03-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2020-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2020-05-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2020-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` """ api_version = self._get_api_version('network_interface_ip_configurations') if api_version == '2017-06-01': @@ -3032,6 +3388,10 @@ def network_interface_ip_configurations(self): from ..v2020_03_01.aio.operations_async import NetworkInterfaceIPConfigurationsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkInterfaceIPConfigurationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3064,6 +3424,8 @@ def network_interface_load_balancers(self): * 2019-12-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2020-03-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2020-04-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2020-05-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2020-06-01: :class:`NetworkInterfaceLoadBalancersOperations` """ api_version = self._get_api_version('network_interface_load_balancers') if api_version == '2017-06-01': @@ -3114,6 +3476,10 @@ def network_interface_load_balancers(self): from ..v2020_03_01.aio.operations_async import NetworkInterfaceLoadBalancersOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkInterfaceLoadBalancersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3136,6 +3502,8 @@ def network_interface_tap_configurations(self): * 2019-12-01: :class:`NetworkInterfaceTapConfigurationsOperations` * 2020-03-01: :class:`NetworkInterfaceTapConfigurationsOperations` * 2020-04-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2020-05-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2020-06-01: :class:`NetworkInterfaceTapConfigurationsOperations` """ api_version = self._get_api_version('network_interface_tap_configurations') if api_version == '2018-08-01': @@ -3166,6 +3534,10 @@ def network_interface_tap_configurations(self): from ..v2020_03_01.aio.operations_async import NetworkInterfaceTapConfigurationsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkInterfaceTapConfigurationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3202,6 +3574,8 @@ def network_interfaces(self): * 2019-12-01: :class:`NetworkInterfacesOperations` * 2020-03-01: :class:`NetworkInterfacesOperations` * 2020-04-01: :class:`NetworkInterfacesOperations` + * 2020-05-01: :class:`NetworkInterfacesOperations` + * 2020-06-01: :class:`NetworkInterfacesOperations` """ api_version = self._get_api_version('network_interfaces') if api_version == '2015-06-15': @@ -3260,6 +3634,10 @@ def network_interfaces(self): from ..v2020_03_01.aio.operations_async import NetworkInterfacesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkInterfacesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkInterfacesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkInterfacesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3282,6 +3660,8 @@ def network_profiles(self): * 2019-12-01: :class:`NetworkProfilesOperations` * 2020-03-01: :class:`NetworkProfilesOperations` * 2020-04-01: :class:`NetworkProfilesOperations` + * 2020-05-01: :class:`NetworkProfilesOperations` + * 2020-06-01: :class:`NetworkProfilesOperations` """ api_version = self._get_api_version('network_profiles') if api_version == '2018-08-01': @@ -3312,6 +3692,10 @@ def network_profiles(self): from ..v2020_03_01.aio.operations_async import NetworkProfilesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkProfilesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkProfilesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkProfilesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3348,6 +3732,8 @@ def network_security_groups(self): * 2019-12-01: :class:`NetworkSecurityGroupsOperations` * 2020-03-01: :class:`NetworkSecurityGroupsOperations` * 2020-04-01: :class:`NetworkSecurityGroupsOperations` + * 2020-05-01: :class:`NetworkSecurityGroupsOperations` + * 2020-06-01: :class:`NetworkSecurityGroupsOperations` """ api_version = self._get_api_version('network_security_groups') if api_version == '2015-06-15': @@ -3406,6 +3792,10 @@ def network_security_groups(self): from ..v2020_03_01.aio.operations_async import NetworkSecurityGroupsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkSecurityGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3417,6 +3807,8 @@ def network_virtual_appliances(self): * 2019-12-01: :class:`NetworkVirtualAppliancesOperations` * 2020-03-01: :class:`NetworkVirtualAppliancesOperations` * 2020-04-01: :class:`NetworkVirtualAppliancesOperations` + * 2020-05-01: :class:`NetworkVirtualAppliancesOperations` + * 2020-06-01: :class:`NetworkVirtualAppliancesOperations` """ api_version = self._get_api_version('network_virtual_appliances') if api_version == '2019-12-01': @@ -3425,6 +3817,10 @@ def network_virtual_appliances(self): from ..v2020_03_01.aio.operations_async import NetworkVirtualAppliancesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkVirtualAppliancesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkVirtualAppliancesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkVirtualAppliancesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3460,6 +3856,8 @@ def network_watchers(self): * 2019-12-01: :class:`NetworkWatchersOperations` * 2020-03-01: :class:`NetworkWatchersOperations` * 2020-04-01: :class:`NetworkWatchersOperations` + * 2020-05-01: :class:`NetworkWatchersOperations` + * 2020-06-01: :class:`NetworkWatchersOperations` """ api_version = self._get_api_version('network_watchers') if api_version == '2016-09-01': @@ -3516,6 +3914,10 @@ def network_watchers(self): from ..v2020_03_01.aio.operations_async import NetworkWatchersOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkWatchersOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkWatchersOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkWatchersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3546,6 +3948,8 @@ def operations(self): * 2019-12-01: :class:`Operations` * 2020-03-01: :class:`Operations` * 2020-04-01: :class:`Operations` + * 2020-05-01: :class:`Operations` + * 2020-06-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-09-01': @@ -3592,6 +3996,10 @@ def operations(self): from ..v2020_03_01.aio.operations_async import Operations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import Operations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import Operations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import Operations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3614,6 +4022,8 @@ def p2_svpn_gateways(self): * 2019-12-01: :class:`P2SVpnGatewaysOperations` * 2020-03-01: :class:`P2SVpnGatewaysOperations` * 2020-04-01: :class:`P2SVpnGatewaysOperations` + * 2020-05-01: :class:`P2SVpnGatewaysOperations` + * 2020-06-01: :class:`P2SVpnGatewaysOperations` """ api_version = self._get_api_version('p2_svpn_gateways') if api_version == '2018-08-01': @@ -3644,6 +4054,10 @@ def p2_svpn_gateways(self): from ..v2020_03_01.aio.operations_async import P2SVpnGatewaysOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import P2SVpnGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import P2SVpnGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import P2SVpnGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3713,6 +4127,8 @@ def packet_captures(self): * 2019-12-01: :class:`PacketCapturesOperations` * 2020-03-01: :class:`PacketCapturesOperations` * 2020-04-01: :class:`PacketCapturesOperations` + * 2020-05-01: :class:`PacketCapturesOperations` + * 2020-06-01: :class:`PacketCapturesOperations` """ api_version = self._get_api_version('packet_captures') if api_version == '2016-09-01': @@ -3769,6 +4185,10 @@ def packet_captures(self): from ..v2020_03_01.aio.operations_async import PacketCapturesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import PacketCapturesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import PacketCapturesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import PacketCapturesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3788,6 +4208,8 @@ def peer_express_route_circuit_connections(self): * 2019-12-01: :class:`PeerExpressRouteCircuitConnectionsOperations` * 2020-03-01: :class:`PeerExpressRouteCircuitConnectionsOperations` * 2020-04-01: :class:`PeerExpressRouteCircuitConnectionsOperations` + * 2020-05-01: :class:`PeerExpressRouteCircuitConnectionsOperations` + * 2020-06-01: :class:`PeerExpressRouteCircuitConnectionsOperations` """ api_version = self._get_api_version('peer_express_route_circuit_connections') if api_version == '2018-12-01': @@ -3812,6 +4234,10 @@ def peer_express_route_circuit_connections(self): from ..v2020_03_01.aio.operations_async import PeerExpressRouteCircuitConnectionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import PeerExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import PeerExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import PeerExpressRouteCircuitConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3822,12 +4248,18 @@ def private_dns_zone_groups(self): * 2020-03-01: :class:`PrivateDnsZoneGroupsOperations` * 2020-04-01: :class:`PrivateDnsZoneGroupsOperations` + * 2020-05-01: :class:`PrivateDnsZoneGroupsOperations` + * 2020-06-01: :class:`PrivateDnsZoneGroupsOperations` """ api_version = self._get_api_version('private_dns_zone_groups') if api_version == '2020-03-01': from ..v2020_03_01.aio.operations_async import PrivateDnsZoneGroupsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import PrivateDnsZoneGroupsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import PrivateDnsZoneGroupsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import PrivateDnsZoneGroupsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3845,6 +4277,8 @@ def private_endpoints(self): * 2019-12-01: :class:`PrivateEndpointsOperations` * 2020-03-01: :class:`PrivateEndpointsOperations` * 2020-04-01: :class:`PrivateEndpointsOperations` + * 2020-05-01: :class:`PrivateEndpointsOperations` + * 2020-06-01: :class:`PrivateEndpointsOperations` """ api_version = self._get_api_version('private_endpoints') if api_version == '2019-04-01': @@ -3865,6 +4299,10 @@ def private_endpoints(self): from ..v2020_03_01.aio.operations_async import PrivateEndpointsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import PrivateEndpointsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import PrivateEndpointsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import PrivateEndpointsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3882,6 +4320,8 @@ def private_link_services(self): * 2019-12-01: :class:`PrivateLinkServicesOperations` * 2020-03-01: :class:`PrivateLinkServicesOperations` * 2020-04-01: :class:`PrivateLinkServicesOperations` + * 2020-05-01: :class:`PrivateLinkServicesOperations` + * 2020-06-01: :class:`PrivateLinkServicesOperations` """ api_version = self._get_api_version('private_link_services') if api_version == '2019-04-01': @@ -3902,6 +4342,10 @@ def private_link_services(self): from ..v2020_03_01.aio.operations_async import PrivateLinkServicesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import PrivateLinkServicesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import PrivateLinkServicesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import PrivateLinkServicesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -3938,6 +4382,8 @@ def public_ip_addresses(self): * 2019-12-01: :class:`PublicIPAddressesOperations` * 2020-03-01: :class:`PublicIPAddressesOperations` * 2020-04-01: :class:`PublicIPAddressesOperations` + * 2020-05-01: :class:`PublicIPAddressesOperations` + * 2020-06-01: :class:`PublicIPAddressesOperations` """ api_version = self._get_api_version('public_ip_addresses') if api_version == '2015-06-15': @@ -3996,6 +4442,10 @@ def public_ip_addresses(self): from ..v2020_03_01.aio.operations_async import PublicIPAddressesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import PublicIPAddressesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import PublicIPAddressesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import PublicIPAddressesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4019,6 +4469,8 @@ def public_ip_prefixes(self): * 2019-12-01: :class:`PublicIPPrefixesOperations` * 2020-03-01: :class:`PublicIPPrefixesOperations` * 2020-04-01: :class:`PublicIPPrefixesOperations` + * 2020-05-01: :class:`PublicIPPrefixesOperations` + * 2020-06-01: :class:`PublicIPPrefixesOperations` """ api_version = self._get_api_version('public_ip_prefixes') if api_version == '2018-07-01': @@ -4051,6 +4503,10 @@ def public_ip_prefixes(self): from ..v2020_03_01.aio.operations_async import PublicIPPrefixesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import PublicIPPrefixesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import PublicIPPrefixesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import PublicIPPrefixesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4069,6 +4525,8 @@ def resource_navigation_links(self): * 2019-12-01: :class:`ResourceNavigationLinksOperations` * 2020-03-01: :class:`ResourceNavigationLinksOperations` * 2020-04-01: :class:`ResourceNavigationLinksOperations` + * 2020-05-01: :class:`ResourceNavigationLinksOperations` + * 2020-06-01: :class:`ResourceNavigationLinksOperations` """ api_version = self._get_api_version('resource_navigation_links') if api_version == '2019-02-01': @@ -4091,6 +4549,10 @@ def resource_navigation_links(self): from ..v2020_03_01.aio.operations_async import ResourceNavigationLinksOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ResourceNavigationLinksOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ResourceNavigationLinksOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ResourceNavigationLinksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4125,6 +4587,8 @@ def route_filter_rules(self): * 2019-12-01: :class:`RouteFilterRulesOperations` * 2020-03-01: :class:`RouteFilterRulesOperations` * 2020-04-01: :class:`RouteFilterRulesOperations` + * 2020-05-01: :class:`RouteFilterRulesOperations` + * 2020-06-01: :class:`RouteFilterRulesOperations` """ api_version = self._get_api_version('route_filter_rules') if api_version == '2016-12-01': @@ -4179,6 +4643,10 @@ def route_filter_rules(self): from ..v2020_03_01.aio.operations_async import RouteFilterRulesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import RouteFilterRulesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import RouteFilterRulesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import RouteFilterRulesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4213,6 +4681,8 @@ def route_filters(self): * 2019-12-01: :class:`RouteFiltersOperations` * 2020-03-01: :class:`RouteFiltersOperations` * 2020-04-01: :class:`RouteFiltersOperations` + * 2020-05-01: :class:`RouteFiltersOperations` + * 2020-06-01: :class:`RouteFiltersOperations` """ api_version = self._get_api_version('route_filters') if api_version == '2016-12-01': @@ -4267,6 +4737,10 @@ def route_filters(self): from ..v2020_03_01.aio.operations_async import RouteFiltersOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import RouteFiltersOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import RouteFiltersOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import RouteFiltersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4303,6 +4777,8 @@ def route_tables(self): * 2019-12-01: :class:`RouteTablesOperations` * 2020-03-01: :class:`RouteTablesOperations` * 2020-04-01: :class:`RouteTablesOperations` + * 2020-05-01: :class:`RouteTablesOperations` + * 2020-06-01: :class:`RouteTablesOperations` """ api_version = self._get_api_version('route_tables') if api_version == '2015-06-15': @@ -4361,6 +4837,10 @@ def route_tables(self): from ..v2020_03_01.aio.operations_async import RouteTablesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import RouteTablesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import RouteTablesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import RouteTablesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4397,6 +4877,8 @@ def routes(self): * 2019-12-01: :class:`RoutesOperations` * 2020-03-01: :class:`RoutesOperations` * 2020-04-01: :class:`RoutesOperations` + * 2020-05-01: :class:`RoutesOperations` + * 2020-06-01: :class:`RoutesOperations` """ api_version = self._get_api_version('routes') if api_version == '2015-06-15': @@ -4455,6 +4937,10 @@ def routes(self): from ..v2020_03_01.aio.operations_async import RoutesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import RoutesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import RoutesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import RoutesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4465,12 +4951,18 @@ def security_partner_providers(self): * 2020-03-01: :class:`SecurityPartnerProvidersOperations` * 2020-04-01: :class:`SecurityPartnerProvidersOperations` + * 2020-05-01: :class:`SecurityPartnerProvidersOperations` + * 2020-06-01: :class:`SecurityPartnerProvidersOperations` """ api_version = self._get_api_version('security_partner_providers') if api_version == '2020-03-01': from ..v2020_03_01.aio.operations_async import SecurityPartnerProvidersOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import SecurityPartnerProvidersOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import SecurityPartnerProvidersOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import SecurityPartnerProvidersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4507,6 +4999,8 @@ def security_rules(self): * 2019-12-01: :class:`SecurityRulesOperations` * 2020-03-01: :class:`SecurityRulesOperations` * 2020-04-01: :class:`SecurityRulesOperations` + * 2020-05-01: :class:`SecurityRulesOperations` + * 2020-06-01: :class:`SecurityRulesOperations` """ api_version = self._get_api_version('security_rules') if api_version == '2015-06-15': @@ -4565,6 +5059,10 @@ def security_rules(self): from ..v2020_03_01.aio.operations_async import SecurityRulesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import SecurityRulesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import SecurityRulesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import SecurityRulesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4583,6 +5081,8 @@ def service_association_links(self): * 2019-12-01: :class:`ServiceAssociationLinksOperations` * 2020-03-01: :class:`ServiceAssociationLinksOperations` * 2020-04-01: :class:`ServiceAssociationLinksOperations` + * 2020-05-01: :class:`ServiceAssociationLinksOperations` + * 2020-06-01: :class:`ServiceAssociationLinksOperations` """ api_version = self._get_api_version('service_association_links') if api_version == '2019-02-01': @@ -4605,6 +5105,10 @@ def service_association_links(self): from ..v2020_03_01.aio.operations_async import ServiceAssociationLinksOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ServiceAssociationLinksOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ServiceAssociationLinksOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ServiceAssociationLinksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4628,6 +5132,8 @@ def service_endpoint_policies(self): * 2019-12-01: :class:`ServiceEndpointPoliciesOperations` * 2020-03-01: :class:`ServiceEndpointPoliciesOperations` * 2020-04-01: :class:`ServiceEndpointPoliciesOperations` + * 2020-05-01: :class:`ServiceEndpointPoliciesOperations` + * 2020-06-01: :class:`ServiceEndpointPoliciesOperations` """ api_version = self._get_api_version('service_endpoint_policies') if api_version == '2018-07-01': @@ -4660,6 +5166,10 @@ def service_endpoint_policies(self): from ..v2020_03_01.aio.operations_async import ServiceEndpointPoliciesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ServiceEndpointPoliciesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4683,6 +5193,8 @@ def service_endpoint_policy_definitions(self): * 2019-12-01: :class:`ServiceEndpointPolicyDefinitionsOperations` * 2020-03-01: :class:`ServiceEndpointPolicyDefinitionsOperations` * 2020-04-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2020-05-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2020-06-01: :class:`ServiceEndpointPolicyDefinitionsOperations` """ api_version = self._get_api_version('service_endpoint_policy_definitions') if api_version == '2018-07-01': @@ -4715,6 +5227,10 @@ def service_endpoint_policy_definitions(self): from ..v2020_03_01.aio.operations_async import ServiceEndpointPolicyDefinitionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ServiceEndpointPolicyDefinitionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4732,6 +5248,8 @@ def service_tags(self): * 2019-12-01: :class:`ServiceTagsOperations` * 2020-03-01: :class:`ServiceTagsOperations` * 2020-04-01: :class:`ServiceTagsOperations` + * 2020-05-01: :class:`ServiceTagsOperations` + * 2020-06-01: :class:`ServiceTagsOperations` """ api_version = self._get_api_version('service_tags') if api_version == '2019-04-01': @@ -4752,6 +5270,10 @@ def service_tags(self): from ..v2020_03_01.aio.operations_async import ServiceTagsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import ServiceTagsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import ServiceTagsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import ServiceTagsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4788,6 +5310,8 @@ def subnets(self): * 2019-12-01: :class:`SubnetsOperations` * 2020-03-01: :class:`SubnetsOperations` * 2020-04-01: :class:`SubnetsOperations` + * 2020-05-01: :class:`SubnetsOperations` + * 2020-06-01: :class:`SubnetsOperations` """ api_version = self._get_api_version('subnets') if api_version == '2015-06-15': @@ -4846,6 +5370,10 @@ def subnets(self): from ..v2020_03_01.aio.operations_async import SubnetsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import SubnetsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import SubnetsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import SubnetsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4882,6 +5410,8 @@ def usages(self): * 2019-12-01: :class:`UsagesOperations` * 2020-03-01: :class:`UsagesOperations` * 2020-04-01: :class:`UsagesOperations` + * 2020-05-01: :class:`UsagesOperations` + * 2020-06-01: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2015-06-15': @@ -4940,6 +5470,90 @@ def usages(self): from ..v2020_03_01.aio.operations_async import UsagesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import UsagesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import UsagesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import UsagesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_appliance_sites(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualApplianceSitesOperations` + * 2020-06-01: :class:`VirtualApplianceSitesOperations` + """ + api_version = self._get_api_version('virtual_appliance_sites') + if api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualApplianceSitesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualApplianceSitesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_appliance_skus(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualApplianceSkusOperations` + * 2020-06-01: :class:`VirtualApplianceSkusOperations` + """ + api_version = self._get_api_version('virtual_appliance_skus') + if api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualApplianceSkusOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualApplianceSkusOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_hub_bgp_connection(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualHubBgpConnectionOperations` + * 2020-06-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_async import VirtualHubBgpConnectionOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualHubBgpConnectionOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_hub_bgp_connections(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualHubBgpConnectionsOperations` + * 2020-06-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_async import VirtualHubBgpConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualHubBgpConnectionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def virtual_hub_ip_configuration(self): + """Instance depends on the API version: + + * 2020-05-01: :class:`VirtualHubIpConfigurationOperations` + * 2020-06-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_async import VirtualHubIpConfigurationOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualHubIpConfigurationOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4953,6 +5567,8 @@ def virtual_hub_route_table_v2_s(self): * 2019-12-01: :class:`VirtualHubRouteTableV2SOperations` * 2020-03-01: :class:`VirtualHubRouteTableV2SOperations` * 2020-04-01: :class:`VirtualHubRouteTableV2SOperations` + * 2020-05-01: :class:`VirtualHubRouteTableV2SOperations` + * 2020-06-01: :class:`VirtualHubRouteTableV2SOperations` """ api_version = self._get_api_version('virtual_hub_route_table_v2_s') if api_version == '2019-09-01': @@ -4965,6 +5581,10 @@ def virtual_hub_route_table_v2_s(self): from ..v2020_03_01.aio.operations_async import VirtualHubRouteTableV2SOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualHubRouteTableV2SOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualHubRouteTableV2SOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualHubRouteTableV2SOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -4990,6 +5610,8 @@ def virtual_hubs(self): * 2019-12-01: :class:`VirtualHubsOperations` * 2020-03-01: :class:`VirtualHubsOperations` * 2020-04-01: :class:`VirtualHubsOperations` + * 2020-05-01: :class:`VirtualHubsOperations` + * 2020-06-01: :class:`VirtualHubsOperations` """ api_version = self._get_api_version('virtual_hubs') if api_version == '2018-04-01': @@ -5026,6 +5648,10 @@ def virtual_hubs(self): from ..v2020_03_01.aio.operations_async import VirtualHubsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualHubsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualHubsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualHubsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5062,6 +5688,8 @@ def virtual_network_gateway_connections(self): * 2019-12-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2020-03-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2020-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2020-05-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2020-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` """ api_version = self._get_api_version('virtual_network_gateway_connections') if api_version == '2015-06-15': @@ -5120,6 +5748,10 @@ def virtual_network_gateway_connections(self): from ..v2020_03_01.aio.operations_async import VirtualNetworkGatewayConnectionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualNetworkGatewayConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5156,6 +5788,8 @@ def virtual_network_gateways(self): * 2019-12-01: :class:`VirtualNetworkGatewaysOperations` * 2020-03-01: :class:`VirtualNetworkGatewaysOperations` * 2020-04-01: :class:`VirtualNetworkGatewaysOperations` + * 2020-05-01: :class:`VirtualNetworkGatewaysOperations` + * 2020-06-01: :class:`VirtualNetworkGatewaysOperations` """ api_version = self._get_api_version('virtual_network_gateways') if api_version == '2015-06-15': @@ -5214,6 +5848,10 @@ def virtual_network_gateways(self): from ..v2020_03_01.aio.operations_async import VirtualNetworkGatewaysOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualNetworkGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5249,6 +5887,8 @@ def virtual_network_peerings(self): * 2019-12-01: :class:`VirtualNetworkPeeringsOperations` * 2020-03-01: :class:`VirtualNetworkPeeringsOperations` * 2020-04-01: :class:`VirtualNetworkPeeringsOperations` + * 2020-05-01: :class:`VirtualNetworkPeeringsOperations` + * 2020-06-01: :class:`VirtualNetworkPeeringsOperations` """ api_version = self._get_api_version('virtual_network_peerings') if api_version == '2016-09-01': @@ -5305,6 +5945,10 @@ def virtual_network_peerings(self): from ..v2020_03_01.aio.operations_async import VirtualNetworkPeeringsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualNetworkPeeringsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5327,6 +5971,8 @@ def virtual_network_taps(self): * 2019-12-01: :class:`VirtualNetworkTapsOperations` * 2020-03-01: :class:`VirtualNetworkTapsOperations` * 2020-04-01: :class:`VirtualNetworkTapsOperations` + * 2020-05-01: :class:`VirtualNetworkTapsOperations` + * 2020-06-01: :class:`VirtualNetworkTapsOperations` """ api_version = self._get_api_version('virtual_network_taps') if api_version == '2018-08-01': @@ -5357,6 +6003,10 @@ def virtual_network_taps(self): from ..v2020_03_01.aio.operations_async import VirtualNetworkTapsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualNetworkTapsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5393,6 +6043,8 @@ def virtual_networks(self): * 2019-12-01: :class:`VirtualNetworksOperations` * 2020-03-01: :class:`VirtualNetworksOperations` * 2020-04-01: :class:`VirtualNetworksOperations` + * 2020-05-01: :class:`VirtualNetworksOperations` + * 2020-06-01: :class:`VirtualNetworksOperations` """ api_version = self._get_api_version('virtual_networks') if api_version == '2015-06-15': @@ -5451,6 +6103,10 @@ def virtual_networks(self): from ..v2020_03_01.aio.operations_async import VirtualNetworksOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualNetworksOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualNetworksOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualNetworksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5466,6 +6122,8 @@ def virtual_router_peerings(self): * 2019-12-01: :class:`VirtualRouterPeeringsOperations` * 2020-03-01: :class:`VirtualRouterPeeringsOperations` * 2020-04-01: :class:`VirtualRouterPeeringsOperations` + * 2020-05-01: :class:`VirtualRouterPeeringsOperations` + * 2020-06-01: :class:`VirtualRouterPeeringsOperations` """ api_version = self._get_api_version('virtual_router_peerings') if api_version == '2019-07-01': @@ -5482,6 +6140,10 @@ def virtual_router_peerings(self): from ..v2020_03_01.aio.operations_async import VirtualRouterPeeringsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualRouterPeeringsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualRouterPeeringsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualRouterPeeringsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5497,6 +6159,8 @@ def virtual_routers(self): * 2019-12-01: :class:`VirtualRoutersOperations` * 2020-03-01: :class:`VirtualRoutersOperations` * 2020-04-01: :class:`VirtualRoutersOperations` + * 2020-05-01: :class:`VirtualRoutersOperations` + * 2020-06-01: :class:`VirtualRoutersOperations` """ api_version = self._get_api_version('virtual_routers') if api_version == '2019-07-01': @@ -5513,6 +6177,10 @@ def virtual_routers(self): from ..v2020_03_01.aio.operations_async import VirtualRoutersOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualRoutersOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualRoutersOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualRoutersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5538,6 +6206,8 @@ def virtual_wans(self): * 2019-12-01: :class:`VirtualWansOperations` * 2020-03-01: :class:`VirtualWansOperations` * 2020-04-01: :class:`VirtualWansOperations` + * 2020-05-01: :class:`VirtualWansOperations` + * 2020-06-01: :class:`VirtualWansOperations` """ api_version = self._get_api_version('virtual_wans') if api_version == '2018-04-01': @@ -5574,6 +6244,10 @@ def virtual_wans(self): from ..v2020_03_01.aio.operations_async import VirtualWansOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VirtualWansOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VirtualWansOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VirtualWansOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5599,6 +6273,8 @@ def vpn_connections(self): * 2019-12-01: :class:`VpnConnectionsOperations` * 2020-03-01: :class:`VpnConnectionsOperations` * 2020-04-01: :class:`VpnConnectionsOperations` + * 2020-05-01: :class:`VpnConnectionsOperations` + * 2020-06-01: :class:`VpnConnectionsOperations` """ api_version = self._get_api_version('vpn_connections') if api_version == '2018-04-01': @@ -5635,6 +6311,10 @@ def vpn_connections(self): from ..v2020_03_01.aio.operations_async import VpnConnectionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VpnConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VpnConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VpnConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5660,6 +6340,8 @@ def vpn_gateways(self): * 2019-12-01: :class:`VpnGatewaysOperations` * 2020-03-01: :class:`VpnGatewaysOperations` * 2020-04-01: :class:`VpnGatewaysOperations` + * 2020-05-01: :class:`VpnGatewaysOperations` + * 2020-06-01: :class:`VpnGatewaysOperations` """ api_version = self._get_api_version('vpn_gateways') if api_version == '2018-04-01': @@ -5696,6 +6378,10 @@ def vpn_gateways(self): from ..v2020_03_01.aio.operations_async import VpnGatewaysOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VpnGatewaysOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VpnGatewaysOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VpnGatewaysOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5712,6 +6398,8 @@ def vpn_link_connections(self): * 2019-12-01: :class:`VpnLinkConnectionsOperations` * 2020-03-01: :class:`VpnLinkConnectionsOperations` * 2020-04-01: :class:`VpnLinkConnectionsOperations` + * 2020-05-01: :class:`VpnLinkConnectionsOperations` + * 2020-06-01: :class:`VpnLinkConnectionsOperations` """ api_version = self._get_api_version('vpn_link_connections') if api_version == '2019-06-01': @@ -5730,6 +6418,10 @@ def vpn_link_connections(self): from ..v2020_03_01.aio.operations_async import VpnLinkConnectionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VpnLinkConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VpnLinkConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VpnLinkConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5744,6 +6436,8 @@ def vpn_server_configurations(self): * 2019-12-01: :class:`VpnServerConfigurationsOperations` * 2020-03-01: :class:`VpnServerConfigurationsOperations` * 2020-04-01: :class:`VpnServerConfigurationsOperations` + * 2020-05-01: :class:`VpnServerConfigurationsOperations` + * 2020-06-01: :class:`VpnServerConfigurationsOperations` """ api_version = self._get_api_version('vpn_server_configurations') if api_version == '2019-08-01': @@ -5758,6 +6452,10 @@ def vpn_server_configurations(self): from ..v2020_03_01.aio.operations_async import VpnServerConfigurationsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VpnServerConfigurationsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VpnServerConfigurationsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VpnServerConfigurationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5772,6 +6470,8 @@ def vpn_server_configurations_associated_with_virtual_wan(self): * 2019-12-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` * 2020-03-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` * 2020-04-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` + * 2020-05-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` + * 2020-06-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` """ api_version = self._get_api_version('vpn_server_configurations_associated_with_virtual_wan') if api_version == '2019-08-01': @@ -5786,6 +6486,10 @@ def vpn_server_configurations_associated_with_virtual_wan(self): from ..v2020_03_01.aio.operations_async import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5802,6 +6506,8 @@ def vpn_site_link_connections(self): * 2019-12-01: :class:`VpnSiteLinkConnectionsOperations` * 2020-03-01: :class:`VpnSiteLinkConnectionsOperations` * 2020-04-01: :class:`VpnSiteLinkConnectionsOperations` + * 2020-05-01: :class:`VpnSiteLinkConnectionsOperations` + * 2020-06-01: :class:`VpnSiteLinkConnectionsOperations` """ api_version = self._get_api_version('vpn_site_link_connections') if api_version == '2019-06-01': @@ -5820,6 +6526,10 @@ def vpn_site_link_connections(self): from ..v2020_03_01.aio.operations_async import VpnSiteLinkConnectionsOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VpnSiteLinkConnectionsOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VpnSiteLinkConnectionsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VpnSiteLinkConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5836,6 +6546,8 @@ def vpn_site_links(self): * 2019-12-01: :class:`VpnSiteLinksOperations` * 2020-03-01: :class:`VpnSiteLinksOperations` * 2020-04-01: :class:`VpnSiteLinksOperations` + * 2020-05-01: :class:`VpnSiteLinksOperations` + * 2020-06-01: :class:`VpnSiteLinksOperations` """ api_version = self._get_api_version('vpn_site_links') if api_version == '2019-06-01': @@ -5854,6 +6566,10 @@ def vpn_site_links(self): from ..v2020_03_01.aio.operations_async import VpnSiteLinksOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VpnSiteLinksOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VpnSiteLinksOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VpnSiteLinksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5879,6 +6595,8 @@ def vpn_sites(self): * 2019-12-01: :class:`VpnSitesOperations` * 2020-03-01: :class:`VpnSitesOperations` * 2020-04-01: :class:`VpnSitesOperations` + * 2020-05-01: :class:`VpnSitesOperations` + * 2020-06-01: :class:`VpnSitesOperations` """ api_version = self._get_api_version('vpn_sites') if api_version == '2018-04-01': @@ -5915,6 +6633,10 @@ def vpn_sites(self): from ..v2020_03_01.aio.operations_async import VpnSitesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VpnSitesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VpnSitesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VpnSitesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5940,6 +6662,8 @@ def vpn_sites_configuration(self): * 2019-12-01: :class:`VpnSitesConfigurationOperations` * 2020-03-01: :class:`VpnSitesConfigurationOperations` * 2020-04-01: :class:`VpnSitesConfigurationOperations` + * 2020-05-01: :class:`VpnSitesConfigurationOperations` + * 2020-06-01: :class:`VpnSitesConfigurationOperations` """ api_version = self._get_api_version('vpn_sites_configuration') if api_version == '2018-04-01': @@ -5976,6 +6700,10 @@ def vpn_sites_configuration(self): from ..v2020_03_01.aio.operations_async import VpnSitesConfigurationOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import VpnSitesConfigurationOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -5995,6 +6723,8 @@ def web_application_firewall_policies(self): * 2019-12-01: :class:`WebApplicationFirewallPoliciesOperations` * 2020-03-01: :class:`WebApplicationFirewallPoliciesOperations` * 2020-04-01: :class:`WebApplicationFirewallPoliciesOperations` + * 2020-05-01: :class:`WebApplicationFirewallPoliciesOperations` + * 2020-06-01: :class:`WebApplicationFirewallPoliciesOperations` """ api_version = self._get_api_version('web_application_firewall_policies') if api_version == '2018-12-01': @@ -6019,6 +6749,10 @@ def web_application_firewall_policies(self): from ..v2020_03_01.aio.operations_async import WebApplicationFirewallPoliciesOperations as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import WebApplicationFirewallPoliciesOperations as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import WebApplicationFirewallPoliciesOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import WebApplicationFirewallPoliciesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_operations_mixin_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_operations_mixin_async.py index 82a85629c321..b913f82488f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_operations_mixin_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/aio/_operations_mixin_async.py @@ -23,72 +23,28 @@ class NetworkManagementClientOperationsMixin(object): - async def check_dns_name_availability( + async def begin_delete_bastion_shareable_link( self, - location: str, - domain_name_label: str, + resource_group_name: str, + bastion_host_name: str, + bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.DnsNameAvailabilityResult": - """Checks whether a domain name in the cloudapp.azure.com zone is available for use. + ) -> AsyncLROPoller[None]: + """Deletes the Bastion Shareable Links for all the VMs specified in the request. - :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 + :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_06_01.models.BastionShareableLinkListRequest :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_04_01.models.DnsNameAvailabilityResult + :return: None, or the result of cls(response) + :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('check_dns_name_availability') - if api_version == '2015-06-15': - from ..v2015_06_15.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2016-09-01': - from ..v2016_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2016-12-01': - from ..v2016_12_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-03-01': - from ..v2017_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-06-01': - from ..v2017_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-08-01': - from ..v2017_08_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-09-01': - from ..v2017_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-10-01': - from ..v2017_10_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2017-11-01': - from ..v2017_11_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-01-01': - from ..v2018_01_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-02-01': - from ..v2018_02_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-04-01': - from ..v2018_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-06-01': - from ..v2018_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-07-01': - from ..v2018_07_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-08-01': - from ..v2018_08_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-10-01': - from ..v2018_10_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-11-01': - from ..v2018_11_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2018-12-01': - from ..v2018_12_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-02-01': - from ..v2019_02_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-04-01': - from ..v2019_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-06-01': - from ..v2019_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-07-01': - from ..v2019_07_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-08-01': - from ..v2019_08_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-09-01': + api_version = self._get_api_version('begin_delete_bastion_shareable_link') + if api_version == '2019-09-01': from ..v2019_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': from ..v2019_11_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass @@ -98,6 +54,10 @@ async def check_dns_name_availability( from ..v2020_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -105,30 +65,35 @@ async def check_dns_name_availability( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.check_dns_name_availability(location, domain_name_label, **kwargs) + return await mixin_instance.begin_delete_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) - async def delete_bastion_shareable_link( + async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( self, resource_group_name: str, - bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + virtual_wan_name: str, + vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> None: - """Deletes the Bastion Shareable Links for all the VMs specified in the request. + ) -> 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 name of the resource group. + :param resource_group_name: The resource group name. :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_04_01.models.BastionShareableLinkListRequest + :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_06_01.models.VirtualWanVpnProfileParameters :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None + :return: VpnProfileResponse, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.VpnProfileResponse :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('delete_bastion_shareable_link') - if api_version == '2019-09-01': + api_version = self._get_api_version('begin_generatevirtualwanvpnserverconfigurationvpnprofile') + if api_version == '2019-08-01': + from ..v2019_08_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-09-01': from ..v2019_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': from ..v2019_11_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass @@ -138,6 +103,10 @@ async def delete_bastion_shareable_link( from ..v2020_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -145,29 +114,26 @@ async def delete_bastion_shareable_link( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.delete_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) + return await mixin_instance.begin_generatevirtualwanvpnserverconfigurationvpnprofile(resource_group_name, virtual_wan_name, vpn_client_params, **kwargs) - def disconnect_active_sessions( + async def begin_get_active_sessions( self, resource_group_name: str, bastion_host_name: str, - session_ids: "models.SessionIds", **kwargs - ) -> AsyncItemPaged["models.BastionSessionDeleteResult"]: + ) -> AsyncLROPoller["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 - :param session_ids: The list of sessionids to disconnect. - :type session_ids: ~azure.mgmt.network.v2020_04_01.models.SessionIds :keyword callable cls: A custom type or function that will be passed the direct response - :return: BastionSessionDeleteResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionSessionDeleteResult + :return: BastionActiveSessionListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('disconnect_active_sessions') + api_version = self._get_api_version('begin_get_active_sessions') if api_version == '2019-09-01': from ..v2019_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': @@ -178,6 +144,10 @@ def disconnect_active_sessions( from ..v2020_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -185,35 +155,30 @@ def disconnect_active_sessions( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.disconnect_active_sessions(resource_group_name, bastion_host_name, session_ids, **kwargs) + return await mixin_instance.begin_get_active_sessions(resource_group_name, bastion_host_name, **kwargs) - async def generatevirtualwanvpnserverconfigurationvpnprofile( + async def begin_put_bastion_shareable_link( self, resource_group_name: str, - virtual_wan_name: str, - vpn_client_params: "models.VirtualWanVpnProfileParameters", + bastion_host_name: str, + bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.VpnProfileResponse": - """Generates a unique VPN profile for P2S clients for VirtualWan and associated - VpnServerConfiguration combination in the specified resource group. + ) -> AsyncLROPoller["models.BastionShareableLinkListResult"]: + """Creates a Bastion Shareable Links for all the VMs specified in the request. - :param resource_group_name: The resource group name. + :param resource_group_name: The name of the resource group. :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_04_01.models.VirtualWanVpnProfileParameters + :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 :keyword callable cls: A custom type or function that will be passed the direct response - :return: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse or None + :return: BastionShareableLinkListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('generatevirtualwanvpnserverconfigurationvpnprofile') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass - elif api_version == '2019-09-01': + api_version = self._get_api_version('begin_put_bastion_shareable_link') + if api_version == '2019-09-01': from ..v2019_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': from ..v2019_11_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass @@ -223,6 +188,10 @@ async def generatevirtualwanvpnserverconfigurationvpnprofile( from ..v2020_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -230,27 +199,74 @@ async def generatevirtualwanvpnserverconfigurationvpnprofile( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.generatevirtualwanvpnserverconfigurationvpnprofile(resource_group_name, virtual_wan_name, vpn_client_params, **kwargs) + return await mixin_instance.begin_put_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) - async def get_active_sessions( + async def check_dns_name_availability( self, - resource_group_name: str, - bastion_host_name: str, + location: str, + domain_name_label: str, **kwargs - ) -> "models.BastionActiveSessionListResult": - """Returns the list of currently active sessions on the Bastion. + ) -> "models.DnsNameAvailabilityResult": + """Checks whether a domain name in the cloudapp.azure.com zone is available for use. - :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 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: BastionActiveSessionListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionActiveSessionListResult or None + :return: DnsNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.DnsNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('get_active_sessions') - if api_version == '2019-09-01': + api_version = self._get_api_version('check_dns_name_availability') + if api_version == '2015-06-15': + from ..v2015_06_15.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2016-09-01': + from ..v2016_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2016-12-01': + from ..v2016_12_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-03-01': + from ..v2017_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-06-01': + from ..v2017_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-08-01': + from ..v2017_08_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-09-01': + from ..v2017_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-10-01': + from ..v2017_10_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-11-01': + from ..v2017_11_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-01-01': + from ..v2018_01_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-02-01': + from ..v2018_02_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-04-01': + from ..v2018_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-06-01': + from ..v2018_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-07-01': + from ..v2018_07_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-08-01': + from ..v2018_08_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-10-01': + from ..v2018_10_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-11-01': + from ..v2018_11_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-12-01': + from ..v2018_12_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-02-01': + from ..v2019_02_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-04-01': + from ..v2019_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-06-01': + from ..v2019_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-07-01': + from ..v2019_07_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-08-01': + from ..v2019_08_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-09-01': from ..v2019_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': from ..v2019_11_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass @@ -260,6 +276,10 @@ async def get_active_sessions( from ..v2020_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -267,29 +287,29 @@ async def get_active_sessions( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.get_active_sessions(resource_group_name, bastion_host_name, **kwargs) + return await mixin_instance.check_dns_name_availability(location, domain_name_label, **kwargs) - def get_bastion_shareable_link( + def disconnect_active_sessions( self, resource_group_name: str, bastion_host_name: str, - bsl_request: "models.BastionShareableLinkListRequest", + session_ids: "models.SessionIds", **kwargs - ) -> AsyncItemPaged["models.BastionShareableLinkListResult"]: - """Return the Bastion Shareable Links for all the VMs specified in the request. + ) -> AsyncItemPaged["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 bsl_request: Post request for all the Bastion Shareable Link endpoints. - :type bsl_request: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListRequest + :param session_ids: The list of sessionids to disconnect. + :type session_ids: ~azure.mgmt.network.v2020_06_01.models.SessionIds :keyword callable cls: A custom type or function that will be passed the direct response - :return: BastionShareableLinkListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult + :return: BastionSessionDeleteResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionSessionDeleteResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('get_bastion_shareable_link') + api_version = self._get_api_version('disconnect_active_sessions') if api_version == '2019-09-01': from ..v2019_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': @@ -300,6 +320,10 @@ def get_bastion_shareable_link( from ..v2020_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -307,29 +331,29 @@ def get_bastion_shareable_link( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.get_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) + return mixin_instance.disconnect_active_sessions(resource_group_name, bastion_host_name, session_ids, **kwargs) - async def put_bastion_shareable_link( + def get_bastion_shareable_link( self, resource_group_name: str, bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": - """Creates a Bastion Shareable Links for all the VMs specified in the request. + ) -> 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. :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_04_01.models.BastionShareableLinkListRequest + :type bsl_request: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: BastionShareableLinkListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult or None + :rtype: ~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('put_bastion_shareable_link') + api_version = self._get_api_version('get_bastion_shareable_link') if api_version == '2019-09-01': from ..v2019_09_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2019-11-01': @@ -340,6 +364,10 @@ async def put_bastion_shareable_link( from ..v2020_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) mixin_instance = OperationClass() @@ -347,7 +375,7 @@ async def put_bastion_shareable_link( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.put_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) + return mixin_instance.get_bastion_shareable_link(resource_group_name, bastion_host_name, bsl_request, **kwargs) async def supported_security_providers( self, @@ -364,7 +392,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_04_01.models.VirtualWanSecurityProviders + :rtype: ~azure.mgmt.network.v2020_06_01.models.VirtualWanSecurityProviders :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('supported_security_providers') @@ -396,6 +424,10 @@ async def supported_security_providers( from ..v2020_03_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass elif api_version == '2020-04-01': from ..v2020_04_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-05-01': + from ..v2020_05_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations_async import NetworkManagementClientOperationsMixin as OperationClass else: raise NotImplementedError("APIVersion {} is not available".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 8f4a28fbece4..2d5c5c0623ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py @@ -7,3 +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 * 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 4071de76afe9..e15f88019ac4 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 @@ -66,11 +66,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "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", "coroutine": true }, @@ -78,6 +76,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_application_gateways_operations_async.py index 3a8d57fe7f3e..4b78a37d0a44 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -477,7 +473,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -496,7 +491,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -509,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +571,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -595,7 +589,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -608,8 +602,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 08ad4df08676..24361380b51c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 7232aa3af7d6..45b723363cad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuits_operations_async.py index 1ee8843cf8dc..036dadd12a91 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -344,6 +340,10 @@ def list_arp_table( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_arp_table.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -416,6 +412,10 @@ def list_routes_table( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_routes_table.metadata['url'] # type: ignore @@ -429,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -488,6 +484,10 @@ def list_stats( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_stats.metadata['url'] # type: ignore @@ -501,15 +501,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -556,6 +552,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -568,15 +568,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -620,6 +616,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -631,15 +631,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_service_providers_operations_async.py index 6bf57dcc01e7..b72b33ad4108 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_load_balancers_operations_async.py index 063e46f11113..62d77eb95993 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_local_network_gateways_operations_async.py index 67896c7130a0..5233fe2102ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_interfaces_operations_async.py index 9fdc9c926a10..807ef1967a1c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -482,6 +478,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -496,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -554,6 +550,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -567,15 +567,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -654,7 +650,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_management_client_operations_async.py index 71d0e7d0b6d6..9255c2052bc9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_management_client_operations_async.py @@ -61,7 +61,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_security_groups_operations_async.py index 44e36f49e993..14197d7219a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -343,6 +339,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -354,15 +354,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -421,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_public_ip_addresses_operations_async.py index 580be3e1a5a6..2845e83ace2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_route_tables_operations_async.py index dce389e1307d..728ca08c3f98 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_routes_operations_async.py index 3362acdaec47..8e4a65d29852 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_security_rules_operations_async.py index 6c934153cc07..3d9a295fd84a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_subnets_operations_async.py index caed788e18a9..2f12a60bfeae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_usages_operations_async.py index 69ad21b1c7cb..adb130f293ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 76903b3e6609..140f9dcf3558 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -345,6 +341,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -398,8 +394,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" @@ -423,7 +419,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -452,7 +447,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -471,8 +466,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -546,7 +541,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -559,7 +553,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -578,7 +571,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -596,8 +589,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -681,7 +674,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_network_gateways_operations_async.py index 993483dc57dc..bdce59154512 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -393,8 +389,8 @@ async def _reset_initial( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" @@ -418,7 +414,6 @@ async def _reset_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -447,7 +442,7 @@ async def begin_reset( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -463,8 +458,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -538,7 +533,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -565,7 +559,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -582,8 +576,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_networks_operations_async.py index 80620733a6fc..ec14c6cca9cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2015_06_15.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 55943339ec13..307091dd1315 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -489,7 +485,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -509,7 +504,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -590,7 +585,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,7 +604,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. 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 d2dd92c0aaa7..4a1e1ad32693 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a5b8fa0597b2..06ca7b095091 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c4faf168f066..3995f162e6a8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -354,6 +350,10 @@ def list_arp_table( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_arp_table.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -427,6 +423,10 @@ def list_routes_table( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_routes_table.metadata['url'] # type: ignore @@ -440,15 +440,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -500,6 +496,10 @@ def list_stats( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_stats.metadata['url'] # type: ignore @@ -513,15 +513,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -569,6 +565,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -581,15 +581,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -634,6 +630,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -645,15 +645,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b00386bcd970..78d673ac97bc 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 @@ -63,6 +63,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 757ed8081156..86e4e9e18147 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f55e803fa2df..be016a686449 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e6ee7f95da61..3a568853e0f9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -494,6 +490,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -508,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -567,6 +563,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -580,15 +580,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -668,7 +664,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 811c90828149..352de1e00762 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 @@ -66,7 +66,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 dcd6ce5499e3..f7c3ea031020 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -353,6 +349,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -364,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -432,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f0b2cf982896..0f7e5da4400a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8ddbfc8a0c1c..994409f5e461 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4b99ff246dd9..2688ac3c43f1 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 66855329b61b..e5a55c351cd9 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 57bf6f386ccc..836142d80f05 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 abe8b212fe6e..20d48d17847b 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 @@ -66,6 +66,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 87a428f4821a..58ff60f819bb 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -355,6 +351,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -409,8 +405,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" @@ -434,7 +430,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -464,7 +459,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -559,7 +554,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -572,7 +566,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -592,7 +585,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -696,7 +689,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 fec145c93cc4..81c83dddc402 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -404,8 +400,8 @@ def _reset_initial( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2015-06-15" @@ -429,7 +425,6 @@ def _reset_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -459,7 +454,7 @@ def begin_reset( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -551,7 +546,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. 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 e9d3fd7561e2..c5831bc82c0c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -352,6 +348,10 @@ def list_all( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2015-06-15" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2f158730a4f5..b9ec203f1716 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 @@ -69,11 +69,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "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", "coroutine": true }, @@ -81,6 +79,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_application_gateways_operations_async.py index 23dd7d837a74..6677465bdbd0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -477,7 +473,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -496,7 +491,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -509,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +571,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -595,7 +589,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -608,8 +602,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -654,8 +648,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -679,7 +673,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -704,7 +697,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -719,8 +712,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 3d6cdfda4b0c..054e81845ef8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 53e362c2ec13..c7ec075971a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuits_operations_async.py index 6e3486d119f2..c6080becfc43 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,8 +323,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -352,7 +348,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -378,7 +373,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -396,8 +391,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -448,8 +443,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -473,7 +468,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -499,7 +493,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -517,8 +511,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -569,8 +563,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -594,7 +588,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -620,7 +613,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -638,8 +631,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -722,7 +715,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -782,7 +774,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -819,6 +810,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -831,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -883,6 +874,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -894,15 +889,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_service_providers_operations_async.py index 1e5735df0023..16bc0f987aa9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_load_balancers_operations_async.py index 82591ceb955c..794f9ff2d3d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_local_network_gateways_operations_async.py index 328e4862b931..427a2428c4e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_interfaces_operations_async.py index 924fb806a6b1..f999e34887a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,6 +70,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,6 +142,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -155,15 +159,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -242,7 +242,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -286,7 +285,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -305,7 +303,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -318,8 +316,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -402,7 +400,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -450,7 +447,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -463,7 +459,6 @@ 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('NetworkInterface', pipeline_response) @@ -482,7 +477,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -497,8 +492,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -558,6 +553,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -569,15 +568,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -624,6 +619,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -636,15 +635,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,8 +671,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -699,7 +694,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -723,7 +717,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -736,8 +730,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -784,8 +778,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -807,7 +801,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -831,7 +824,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -844,8 +837,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_management_client_operations_async.py index 8df40a5bdd88..4afb8ea21a7b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_management_client_operations_async.py @@ -61,7 +61,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_security_groups_operations_async.py index 4e3550eb493f..7ac6945298a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -343,6 +339,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -354,15 +354,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -421,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_watchers_operations_async.py index 5709c47376a6..1d423eedb3cb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -288,6 +284,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -300,15 +300,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -352,6 +348,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,7 +438,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -494,7 +489,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -507,7 +501,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -526,7 +519,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -541,8 +534,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -616,7 +609,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -629,7 +621,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -648,7 +639,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -663,8 +654,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -738,7 +729,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -751,7 +741,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -770,7 +759,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -785,8 +774,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -860,7 +849,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -873,7 +861,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -892,7 +879,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -907,8 +894,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -982,7 +969,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -995,7 +981,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1014,7 +999,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1029,8 +1014,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1104,7 +1089,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1117,7 +1101,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1136,7 +1119,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": + ) -> AsyncLROPoller["models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1151,8 +1134,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1226,7 +1209,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1239,7 +1221,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1258,7 +1239,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1273,8 +1254,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_packet_captures_operations_async.py index 7104a2f03d33..518451c8b86a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_public_ip_addresses_operations_async.py index 8d1120d0c159..1fcecbdcb21a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_route_tables_operations_async.py index 08a22fa8d313..3d48591960c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_routes_operations_async.py index dbb466a83445..47da1186bbb5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_security_rules_operations_async.py index 3ef5ff990139..f1c369004158 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_subnets_operations_async.py index 5c8908caa574..bbc1bdbf5187 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_usages_operations_async.py index d8cabdf1d773..c2c02c34d14d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 8c4a154ba291..f714de181810 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -368,7 +363,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -387,7 +381,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -405,8 +399,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -490,7 +484,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -528,6 +521,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -540,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +574,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -606,7 +599,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -635,7 +627,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -654,8 +646,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 49b16007cbe9..214a06effc0a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -393,8 +389,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -418,7 +414,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -443,7 +438,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -459,8 +454,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -534,7 +529,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -561,7 +555,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -578,8 +572,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -628,8 +622,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -653,7 +647,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -678,7 +671,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -693,8 +686,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -742,8 +735,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -765,7 +758,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -789,7 +781,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -803,8 +795,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -852,8 +844,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -876,7 +868,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -901,7 +892,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -917,8 +908,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 78722dbefa2e..c780f61bba0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_networks_operations_async.py index c896bb089954..d270ce99de5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_09_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -499,7 +495,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 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 f77f6aa17cf5..d4cb0e4965c3 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -489,7 +485,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -509,7 +504,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -590,7 +585,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,7 +604,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -670,8 +664,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -695,7 +689,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -721,7 +714,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 961211d7f840..ec829924f31c 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f887b39366e6..923f89b85e39 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ee3bba505a22..18905785ab78 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -337,8 +333,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -362,7 +358,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -389,7 +384,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -460,8 +455,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -485,7 +480,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,7 +506,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -583,8 +577,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -608,7 +602,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -635,7 +628,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -738,7 +731,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -799,7 +791,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -837,6 +828,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -849,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -902,6 +893,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -913,15 +908,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 952d2bc53c12..75efc1d403b7 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 @@ -63,6 +63,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9d6ae1e95de1..f0e58ac9e4e3 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9dee6326399d..67d7d941d100 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 274f14e4abdc..913c9cb51ccd 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 @@ -75,6 +75,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -89,15 +93,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,6 +148,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -161,15 +165,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -249,7 +249,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +293,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -314,7 +312,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -412,7 +410,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -461,7 +458,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -474,7 +470,6 @@ 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('NetworkInterface', pipeline_response) @@ -494,7 +489,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -571,6 +566,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -582,15 +581,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -638,6 +633,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -650,15 +649,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,8 +686,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -714,7 +709,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -739,7 +733,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -801,8 +795,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -824,7 +818,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -849,7 +842,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. 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 be250c491880..281dc23126fc 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 @@ -66,7 +66,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 b2be965a2eb7..2e98cd0a3aa8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -353,6 +349,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -364,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -432,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0d312a3723ca..d090097a1021 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -297,6 +293,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -309,15 +309,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -362,6 +358,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,7 +449,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -506,7 +501,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -519,7 +513,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -539,7 +532,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -630,7 +623,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -643,7 +635,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -663,7 +654,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -754,7 +745,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -767,7 +757,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -787,7 +776,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -878,7 +867,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -891,7 +879,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -911,7 +898,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1002,7 +989,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1015,7 +1001,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1035,7 +1020,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1126,7 +1111,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1139,7 +1123,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1159,7 +1142,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1250,7 +1233,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1263,7 +1245,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1283,7 +1264,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 3ac619d3c89c..8dbe429d987f 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 49e4e977fd13..71ddf44dc0b5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a7a488c65d28..392b5ce951d0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 24779305aa0a..feaea926f216 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2bf53098d844..ce0ec22a89af 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 488022745a11..ff70973046dc 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 375a3184073c..f0b2a5ee3404 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 @@ -66,6 +66,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dfdd103d3e1d..30f5be3aed32 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -378,7 +373,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -398,7 +392,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -502,7 +496,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -541,6 +534,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -553,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +588,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -620,7 +613,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -650,7 +642,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 c2f6b5d1f42a..6887f31fae09 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -404,8 +400,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -429,7 +425,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +450,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -547,7 +542,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -575,7 +569,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -643,8 +637,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -668,7 +662,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -694,7 +687,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -759,8 +752,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -782,7 +775,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -807,7 +799,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -871,8 +863,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" @@ -895,7 +887,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -921,7 +912,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. 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 b2bbeabcde24..9ab81791af82 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 77a1c1a520c9..0f789d419cee 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -352,6 +348,10 @@ def list_all( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2016-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -511,7 +507,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ea887ff19ae2..1be80433044f 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 @@ -72,11 +72,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "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", "coroutine": true }, @@ -84,6 +82,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_application_gateways_operations_async.py index 1e792956c601..07aba6c6d988 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -477,7 +473,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -496,7 +491,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -509,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +571,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -595,7 +589,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -608,8 +602,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -654,8 +648,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -679,7 +673,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -704,7 +697,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -719,8 +712,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_bgp_service_communities_operations_async.py index 664263dccecb..b8116ee00d7b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 51c3a7268cd8..573951c8ebd9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 31277b04efbb..be1728057fa7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuits_operations_async.py index 07e55f5ddc3c..c34a52f773fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,8 +323,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -352,7 +348,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -378,7 +373,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -396,8 +391,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -448,8 +443,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -473,7 +468,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -499,7 +493,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -517,8 +511,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -569,8 +563,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -594,7 +588,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -620,7 +613,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -638,8 +631,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -722,7 +715,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -782,7 +774,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -819,6 +810,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -831,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -883,6 +874,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -894,15 +889,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_service_providers_operations_async.py index be0427936667..025182356313 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_load_balancers_operations_async.py index fc913483f2d7..1a618e5b1510 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_local_network_gateways_operations_async.py index 26ed6e1696da..b9acdd8a125f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_interfaces_operations_async.py index dd0664353c9a..e40d2b6b29c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,6 +70,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,6 +142,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -155,15 +159,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -242,7 +242,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -286,7 +285,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -305,7 +303,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -318,8 +316,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -402,7 +400,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -450,7 +447,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -463,7 +459,6 @@ 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('NetworkInterface', pipeline_response) @@ -482,7 +477,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -497,8 +492,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -558,6 +553,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -569,15 +568,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -624,6 +619,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -636,15 +635,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,8 +671,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -699,7 +694,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -723,7 +717,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -736,8 +730,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -784,8 +778,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -807,7 +801,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -831,7 +824,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -844,8 +837,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_management_client_operations_async.py index e56f8dc529d2..2fecb853c1b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_management_client_operations_async.py @@ -61,7 +61,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_security_groups_operations_async.py index 32432b183c47..e168dd1e3c94 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -343,6 +339,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -354,15 +354,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -421,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_watchers_operations_async.py index ed1c65424c45..883348c081bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -288,6 +284,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -300,15 +300,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -352,6 +348,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,7 +438,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -494,7 +489,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -507,7 +501,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -526,7 +519,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -541,8 +534,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -616,7 +609,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -629,7 +621,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -648,7 +639,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -663,8 +654,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -738,7 +729,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -751,7 +741,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -770,7 +759,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -785,8 +774,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -860,7 +849,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -873,7 +861,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -892,7 +879,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -907,8 +894,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -982,7 +969,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -995,7 +981,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1014,7 +999,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1029,8 +1014,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1104,7 +1089,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1117,7 +1101,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1136,7 +1119,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": + ) -> AsyncLROPoller["models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1151,8 +1134,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1226,7 +1209,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1239,7 +1221,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1258,7 +1239,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1273,8 +1254,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_packet_captures_operations_async.py index 19905e7c7e91..5814dc0dd048 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_public_ip_addresses_operations_async.py index 43db84418231..a14c3e929901 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_filter_rules_operations_async.py index 70e4b7339f9d..4cdb197d2f5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_filters_operations_async.py index b5ff8fefe80c..8c6f1f03fdad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_tables_operations_async.py index c4dbf27c6d6d..7d83c0c5b85b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_routes_operations_async.py index 7638b579072c..5fad93d33fb8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_security_rules_operations_async.py index 5f402fc872e3..0800f32e03ea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_subnets_operations_async.py index efcde9f9c6ec..c3788795c7fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_usages_operations_async.py index 378b410cb594..d74e2d96df25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index d0f393842124..80c0b1f7ec70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -368,7 +363,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -387,7 +381,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -405,8 +399,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -490,7 +484,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -528,6 +521,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -540,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +574,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -606,7 +599,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -635,7 +627,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -654,8 +646,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 4389b8b12d09..c3214fbd7a60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -393,8 +389,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -418,7 +414,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -443,7 +438,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -459,8 +454,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -534,7 +529,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -561,7 +555,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -578,8 +572,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -628,8 +622,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -653,7 +647,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -678,7 +671,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -693,8 +686,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -742,8 +735,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -765,7 +758,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -789,7 +781,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -803,8 +795,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -852,8 +844,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -876,7 +868,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -901,7 +892,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -917,8 +908,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 07103332e658..ed2f54bf1e22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_networks_operations_async.py index 5bb3a262ac26..38d9c78d9d23 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_12_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2016_12_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -499,7 +495,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 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 436f98a89f17..a6aa63b5a942 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -489,7 +485,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -509,7 +504,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -590,7 +585,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,7 +604,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -670,8 +664,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -695,7 +689,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -721,7 +714,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 cca56c6a0545..21e072944acd 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 @@ -63,6 +63,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cee8765c488e..007932d6b68d 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 798e948ba235..d2c566d0d46c 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 372954098817..b82fdde38079 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -337,8 +333,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -362,7 +358,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -389,7 +384,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -460,8 +455,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -485,7 +480,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,7 +506,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -583,8 +577,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -608,7 +602,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -635,7 +628,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -738,7 +731,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -799,7 +791,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -837,6 +828,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -849,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -902,6 +893,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -913,15 +908,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1e4f5429aecc..0f12ffd5ca34 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 @@ -63,6 +63,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 283c649d8f5c..19bf6d280192 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2ad5e7714108..68716b0dc5e6 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d3836f10cb8a..570db53b821e 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 @@ -75,6 +75,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -89,15 +93,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,6 +148,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -161,15 +165,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -249,7 +249,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +293,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -314,7 +312,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -412,7 +410,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -461,7 +458,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -474,7 +470,6 @@ 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('NetworkInterface', pipeline_response) @@ -494,7 +489,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -571,6 +566,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -582,15 +581,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -638,6 +633,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -650,15 +649,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,8 +686,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -714,7 +709,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -739,7 +733,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -801,8 +795,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -824,7 +818,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -849,7 +842,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. 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 50dac3a706cb..15414f79630a 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 @@ -66,7 +66,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 60124a1d7f75..de9e2de86a56 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -353,6 +349,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -364,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -432,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dc4d8af614d3..6b6e489b68db 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -297,6 +293,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -309,15 +309,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -362,6 +358,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,7 +449,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -506,7 +501,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -519,7 +513,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -539,7 +532,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -630,7 +623,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -643,7 +635,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -663,7 +654,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -754,7 +745,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -767,7 +757,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -787,7 +776,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -878,7 +867,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -891,7 +879,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -911,7 +898,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1002,7 +989,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1015,7 +1001,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1035,7 +1020,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1126,7 +1111,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1139,7 +1123,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1159,7 +1142,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1250,7 +1233,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1263,7 +1245,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1283,7 +1264,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 cce91c1dcacb..cddccbcfae45 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e6be70740f90..545c2a783274 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b91cd1c51d1f..4f95f63df279 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e330023e0372..b2141ca37951 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 adc2553c256b..edf61e8bdf6c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b6c7ba903b86..094b15f000a2 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e9ef7a0c10c2..892109f15ade 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e1b8123d14f4..b8c379460c25 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a5e5e2eda637..c1207bb8a88a 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 @@ -66,6 +66,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 31bde273890b..c3e27b33e793 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -378,7 +373,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -398,7 +392,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -502,7 +496,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -541,6 +534,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -553,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +588,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -620,7 +613,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -650,7 +642,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 6f258981ed18..cf9923b50995 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -404,8 +400,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -429,7 +425,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +450,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -547,7 +542,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -575,7 +569,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -643,8 +637,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -668,7 +662,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -694,7 +687,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -759,8 +752,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -782,7 +775,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -807,7 +799,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -871,8 +863,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2016-12-01" @@ -895,7 +887,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -921,7 +912,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. 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 ecc9a8474a3d..b54e4f2ad22e 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 63a75289397d..2cdbe430c8d9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -352,6 +348,10 @@ def list_all( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2016-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -511,7 +507,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 802ee10fa548..332013bd2393 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 @@ -72,11 +72,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "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", "coroutine": true }, @@ -84,6 +82,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_application_gateways_operations_async.py index e966bc4d4988..51585ba2aeb1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -477,7 +473,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -496,7 +491,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -509,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +571,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -595,7 +589,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -608,8 +602,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -654,8 +648,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -679,7 +673,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -704,7 +697,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -719,8 +712,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -794,7 +787,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_bgp_service_communities_operations_async.py index 4e11b7796f54..b5f3a159863b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 5abfafd042f4..0a7a4625044d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 153c33a3fc97..ab13404092cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuits_operations_async.py index df13b357dfe4..c6548327eb5f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,8 +323,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -352,7 +348,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -378,7 +373,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -396,8 +391,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -448,8 +443,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -473,7 +468,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -499,7 +493,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -517,8 +511,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -569,8 +563,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -594,7 +588,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -620,7 +613,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -638,8 +631,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -722,7 +715,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -782,7 +774,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -819,6 +810,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -831,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -883,6 +874,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -894,15 +889,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_service_providers_operations_async.py index f2671f631227..7dca3e49eede 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_load_balancers_operations_async.py index 9196e27d7ca6..a8cba6da58a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_local_network_gateways_operations_async.py index 5fda5013bfb3..03453f78cda1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_interfaces_operations_async.py index e72dde117307..82b3841f86ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -460,8 +456,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -483,7 +479,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -507,7 +502,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -520,8 +515,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -568,8 +563,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -591,7 +586,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -615,7 +609,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -628,8 +622,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -698,6 +692,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -712,15 +710,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -770,6 +764,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -783,15 +781,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -870,7 +864,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_management_client_operations_async.py index c2e9e4d4ac62..e91eb7efc4c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_management_client_operations_async.py @@ -61,7 +61,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_security_groups_operations_async.py index 322e06a385c6..54c401056580 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -343,6 +339,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -354,15 +354,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -421,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_watchers_operations_async.py index 935bf60d6290..1201c2a6caa1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -288,6 +284,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -300,15 +300,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -352,6 +348,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,7 +438,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -494,7 +489,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -507,7 +501,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -526,7 +519,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -541,8 +534,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -616,7 +609,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -629,7 +621,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -648,7 +639,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -663,8 +654,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -738,7 +729,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -751,7 +741,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -770,7 +759,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -785,8 +774,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -860,7 +849,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -873,7 +861,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -892,7 +879,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -907,8 +894,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -982,7 +969,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -995,7 +981,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1014,7 +999,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1029,8 +1014,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1104,7 +1089,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1117,7 +1101,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1136,7 +1119,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": + ) -> AsyncLROPoller["models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1151,8 +1134,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1226,7 +1209,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1239,7 +1221,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1258,7 +1239,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1273,8 +1254,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1348,7 +1329,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1361,7 +1341,6 @@ async def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1380,7 +1359,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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. @@ -1396,8 +1375,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_packet_captures_operations_async.py index 78390f1ac7b4..a504890e07b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_public_ip_addresses_operations_async.py index 712787511adc..0a4f587b7a11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -478,6 +474,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -491,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -559,6 +555,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -575,15 +575,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -670,7 +666,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_filter_rules_operations_async.py index e1a96268b8a7..9865c52748ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_filters_operations_async.py index 6d77a09a80c7..dedaa9f27995 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_tables_operations_async.py index 30fa480046e6..deb1b4ad912a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_routes_operations_async.py index 839c370b6a53..8955bf2e258f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_security_rules_operations_async.py index 27ba9598d5fb..086dacfad32f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_subnets_operations_async.py index efde63b22ed0..33a3e4a02d1f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_usages_operations_async.py index 7c06dda766df..5a2862106996 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index ad4399debd33..74e81b79801c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -368,7 +363,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -387,7 +381,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -405,8 +399,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -490,7 +484,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -528,6 +521,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -540,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +574,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -606,7 +599,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -635,7 +627,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -654,8 +646,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_gateways_operations_async.py index dc4c627e4753..5e0874b833bf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -393,8 +389,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -418,7 +414,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -443,7 +438,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -459,8 +454,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -534,7 +529,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -561,7 +555,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -578,8 +572,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -628,8 +622,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -653,7 +647,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -678,7 +671,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -693,8 +686,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -742,8 +735,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -765,7 +758,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -789,7 +781,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -803,8 +795,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -852,8 +844,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -876,7 +868,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -901,7 +892,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -917,8 +908,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_peerings_operations_async.py index c0793bb34df2..e9766cd170d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_networks_operations_async.py index 9020569a7120..0f9122fd6155 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_03_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -499,7 +495,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -539,6 +534,10 @@ def list_usage( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -552,15 +551,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 de1fea4d7539..dd7ebac01416 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -489,7 +485,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -509,7 +504,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -590,7 +585,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,7 +604,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -670,8 +664,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -695,7 +689,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -721,7 +714,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -812,7 +805,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5b74f6f6f1e6..b011017e6395 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 05691de3fd35..30fb7e1251d2 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 23dc3b683262..ccf236e2e37a 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fa80615511b9..1f413800e77e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -337,8 +333,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -362,7 +358,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -389,7 +384,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -460,8 +455,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -485,7 +480,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,7 +506,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -583,8 +577,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -608,7 +602,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -635,7 +628,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -738,7 +731,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -799,7 +791,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -837,6 +828,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -849,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -902,6 +893,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -913,15 +908,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2add31e9e073..d132f7764eab 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6a6225f5a0f1..4e15e72e5b31 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2ad58224a4da..3896ee988ad7 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d3886203ad84..cd1454b2ab2e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -472,8 +468,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -495,7 +491,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -520,7 +515,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -582,8 +577,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -605,7 +600,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -630,7 +624,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,6 +708,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -728,15 +726,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -787,6 +781,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -800,15 +798,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -888,7 +882,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 96b95713c192..9a733f1be363 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 @@ -66,7 +66,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 221f7ae4c83a..3acc0593d4cd 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -353,6 +349,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -364,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -432,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 416f2af9ad6e..5d88bfd2f3d4 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -297,6 +293,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -309,15 +309,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -362,6 +358,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,7 +449,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -506,7 +501,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -519,7 +513,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -539,7 +532,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -630,7 +623,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -643,7 +635,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -663,7 +654,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -754,7 +745,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -767,7 +757,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -787,7 +776,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -878,7 +867,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -891,7 +879,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -911,7 +898,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1002,7 +989,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1015,7 +1001,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1035,7 +1020,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1126,7 +1111,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1139,7 +1123,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1159,7 +1142,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1250,7 +1233,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1263,7 +1245,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1283,7 +1264,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1374,7 +1355,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1387,7 +1367,6 @@ def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1407,7 +1386,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 860222bd7062..ef009cebcc47 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 866514a28742..a9d3ed242ed3 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -490,6 +486,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -503,15 +503,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -572,6 +568,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -588,15 +588,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -684,7 +680,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 2260c3b3c95d..e766cc3b1f24 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e942c5eaf030..a4fc24f54489 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 caf99fdf0803..36bc745d4b76 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d58139fb26e0..4a5cf89c5f06 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6c4933b69c72..2536178f127f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fd4016008f7d..2db43e33f631 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6f0a6b5325af..996ecc130c36 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7b672350f09f..4800378ca606 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -378,7 +373,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -398,7 +392,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -502,7 +496,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -541,6 +534,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -553,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +588,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -620,7 +613,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -650,7 +642,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 c5ad49a14daf..38e82197a298 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -404,8 +400,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -429,7 +425,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +450,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -547,7 +542,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -575,7 +569,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -643,8 +637,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -668,7 +662,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -694,7 +687,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -759,8 +752,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -782,7 +775,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -807,7 +799,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -871,8 +863,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01" @@ -895,7 +887,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -921,7 +912,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. 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 a763a4085517..8231398c3f61 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f86ff2728ed1..b077b13f3b2e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -511,7 +507,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -552,6 +547,10 @@ def list_usage( api_version = "2017-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -565,15 +564,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1edf12868777..d68dc9850564 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 @@ -82,11 +82,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "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", "coroutine": true }, @@ -94,6 +92,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_application_gateways_operations_async.py index 039a358ff6ed..055bcf6db9ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -477,7 +473,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -496,7 +491,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -509,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +571,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -595,7 +589,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -608,8 +602,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -654,8 +648,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -679,7 +673,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -704,7 +697,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -719,8 +712,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -794,7 +787,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -842,7 +834,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -876,6 +867,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -887,15 +882,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -957,7 +948,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_available_endpoint_services_operations_async.py index 5b7a63e6cf29..5fc1651f626b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_bgp_service_communities_operations_async.py index a9ea5968b909..f87b8a7121a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_default_security_rules_operations_async.py index 7aade499359b..374597fc944e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index a4509de981e7..e2055a122af8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index b35de2328e90..f6ac33d559f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuits_operations_async.py index 4854686d9ad8..2e43560a7e56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,8 +323,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -352,7 +348,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -378,7 +373,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -396,8 +391,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -448,8 +443,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -473,7 +468,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -499,7 +493,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -517,8 +511,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -569,8 +563,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -594,7 +588,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -620,7 +613,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -638,8 +631,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -722,7 +715,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -782,7 +774,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -819,6 +810,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -831,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -883,6 +874,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -894,15 +889,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_service_providers_operations_async.py index f6b1c1884710..574013b2c5d0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 2ae749bad18f..6641a2e51416 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 82bd91c394a1..54f5d937795c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index f3dde72f5e1e..0f67ea388f2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index f6029a409458..13b37dea0af4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 3d45b23be7a0..3fa158df5259 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_probes_operations_async.py index bfec16d60aed..86d73076ac63 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancers_operations_async.py index 04d987ad2e60..4f6889f16721 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_local_network_gateways_operations_async.py index 7724710f4b7b..d95755b38342 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 32a49effb7fc..826d225b8eaf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index 8180b40c7f0b..54318cc31fdb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interfaces_operations_async.py index 1a0004795b6b..5d9bfab5b02c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -460,8 +456,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -483,7 +479,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -507,7 +502,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -520,8 +515,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -568,8 +563,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -591,7 +586,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -615,7 +609,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -628,8 +622,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -698,6 +692,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -712,15 +710,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -770,6 +764,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -783,15 +781,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -870,7 +864,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_management_client_operations_async.py index 3ec955def900..cce3ec363354 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_management_client_operations_async.py @@ -61,7 +61,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_security_groups_operations_async.py index b383725b9093..4ecf2d8beb3b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -343,6 +339,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -354,15 +354,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -421,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_watchers_operations_async.py index 7ca9817cbac6..2f445c1f51ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -288,6 +284,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -300,15 +300,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -352,6 +348,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,7 +438,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -494,7 +489,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -507,7 +501,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -526,7 +519,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -541,8 +534,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -616,7 +609,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -629,7 +621,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -648,7 +639,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -663,8 +654,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -738,7 +729,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -751,7 +741,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -770,7 +759,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -785,8 +774,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -860,7 +849,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -873,7 +861,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -892,7 +879,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -907,8 +894,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -982,7 +969,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -995,7 +981,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1014,7 +999,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1029,8 +1014,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1104,7 +1089,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1117,7 +1101,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1136,7 +1119,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": + ) -> AsyncLROPoller["models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1151,8 +1134,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1226,7 +1209,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1239,7 +1221,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1258,7 +1239,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1273,8 +1254,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1348,7 +1329,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1361,7 +1341,6 @@ async def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1380,7 +1359,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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. @@ -1396,8 +1375,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_packet_captures_operations_async.py index 760a9efdcfd7..f99f3a7dfe22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_public_ip_addresses_operations_async.py index f6104bbc26ad..801489269c8c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -478,6 +474,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -491,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -559,6 +555,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -575,15 +575,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -670,7 +666,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_filter_rules_operations_async.py index 4372b9b7a3e4..8d391db3ba04 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_filters_operations_async.py index 101a2467a34a..5e932b5e8a95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_tables_operations_async.py index 3fa5baaa0c70..0c1f4ce38ee9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_routes_operations_async.py index 9171cd154473..6dad26cadcae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_security_rules_operations_async.py index 3f0e4f52479d..0d5f9b58c632 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_subnets_operations_async.py index 6a2d9e80d2b0..a8548911f0bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_usages_operations_async.py index d5bbca2601ab..fb5357802267 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index d1c9d5222d66..ea83b4696616 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -368,7 +363,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -387,7 +381,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -405,8 +399,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -490,7 +484,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -528,6 +521,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -540,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +574,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -606,7 +599,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -635,7 +627,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -654,8 +646,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py index af4f6afe6182..3e13b0f65014 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -410,6 +406,10 @@ def list_connections( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -423,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -464,8 +460,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -489,7 +485,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -514,7 +509,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -530,8 +525,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -580,8 +575,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -605,7 +600,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -634,7 +628,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -651,8 +645,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -726,7 +720,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -753,7 +746,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -770,8 +763,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -820,8 +813,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -845,7 +838,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -870,7 +862,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -885,8 +877,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -934,8 +926,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -957,7 +949,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -981,7 +972,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -995,8 +986,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1044,8 +1035,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -1068,7 +1059,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1093,7 +1083,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1109,8 +1099,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 1e850852a861..4fdc5a2378a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_networks_operations_async.py index e2f25cca745a..eab4efb1d4b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_06_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -499,7 +495,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -539,6 +534,10 @@ def list_usage( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -552,15 +551,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 6f6523802449..20b0e9d750fe 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -489,7 +485,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -509,7 +504,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -590,7 +585,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,7 +604,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -670,8 +664,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -695,7 +689,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -721,7 +714,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -812,7 +805,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -861,7 +853,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -896,6 +887,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -907,15 +902,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -978,7 +969,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3ca5cb704949..516e2dfb86e9 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3ae8ba0a31c1..0a3ebf5ffa88 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 939c3ca209f9..65fdaef2aabb 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e2e43244b1d3..0ed5047673da 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 08e5969d8bff..039a6b7da6a6 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d334f46a0102..f76960c1048f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -337,8 +333,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -362,7 +358,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -389,7 +384,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -460,8 +455,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -485,7 +480,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,7 +506,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -583,8 +577,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -608,7 +602,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -635,7 +628,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -738,7 +731,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -799,7 +791,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -837,6 +828,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -849,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -902,6 +893,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -913,15 +908,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9b3f3af318b6..e2adbc52dc6f 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 21e448b29afb..48d4b2c3c25c 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 @@ -71,6 +71,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 48cb74f4c68b..c1111d2c293f 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 fc5351239f9a..0fb3ee60a817 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e2508ecb9d9e..df9dc0723dae 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 4596521b2d4e..4f6f5fb0311c 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2d76e403fdd2..a6a47a915e7e 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d250a4237629..3e5a39319b69 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 065b5570f983..91b43d48d321 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ecbe74f15f55..089947ef81d6 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 310a5783a25d..23d1e7f9218b 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4cb52e9109b8..d04344fff9dd 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -472,8 +468,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -495,7 +491,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -520,7 +515,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -582,8 +577,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -605,7 +600,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -630,7 +624,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,6 +708,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -728,15 +726,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -787,6 +781,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -800,15 +798,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -888,7 +882,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 66041336ff4d..a2d8936b7aa1 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 @@ -66,7 +66,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 777b26ad5f85..1e399691ffab 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -353,6 +349,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -364,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -432,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4d561a1d17b3..b874133992db 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -297,6 +293,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -309,15 +309,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -362,6 +358,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,7 +449,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -506,7 +501,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -519,7 +513,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -539,7 +532,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -630,7 +623,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -643,7 +635,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -663,7 +654,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -754,7 +745,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -767,7 +757,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -787,7 +776,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -878,7 +867,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -891,7 +879,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -911,7 +898,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1002,7 +989,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1015,7 +1001,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1035,7 +1020,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1126,7 +1111,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1139,7 +1123,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1159,7 +1142,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1250,7 +1233,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1263,7 +1245,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1283,7 +1264,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1374,7 +1355,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1387,7 +1367,6 @@ def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1407,7 +1386,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 4483c334340b..6fcbda87328e 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4097d161583b..d1abacdcb540 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -490,6 +486,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -503,15 +503,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -572,6 +568,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -588,15 +588,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -684,7 +680,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 36946732abb5..945673f35d50 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1349adde707c..cf70ec8d7302 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b4b74b52569d..bdafbdc30ce0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4945d9a495a1..e3a127d76c7f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 684ac7bc393f..85048064ac5d 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 056f54a8b50c..a82144de3dd8 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1596971c9de5..25979d53388b 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b37421c5beb2..34df2d47b8e9 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -378,7 +373,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -398,7 +392,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -502,7 +496,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -541,6 +534,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -553,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +588,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -620,7 +613,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -650,7 +642,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 9d1724aa9a4f..e5787094e5e6 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -421,6 +417,10 @@ def list_connections( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -434,15 +434,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -476,8 +472,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -501,7 +497,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -527,7 +522,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -594,8 +589,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -619,7 +614,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -649,7 +643,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -742,7 +736,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -770,7 +763,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -838,8 +831,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -863,7 +856,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -889,7 +881,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -954,8 +946,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -977,7 +969,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1002,7 +993,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1066,8 +1057,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-06-01" @@ -1090,7 +1081,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1116,7 +1106,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. 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 2f51653bf059..407a465e58f4 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 54567fa697b5..ec740cb0afde 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -511,7 +507,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -552,6 +547,10 @@ def list_usage( api_version = "2017-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -565,15 +564,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 56132c619d58..913ceed89a55 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 @@ -82,11 +82,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -94,6 +92,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_application_gateways_operations_async.py index ed876d135528..545a9a78465b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -477,7 +473,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -496,7 +491,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -509,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +571,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -595,7 +589,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -608,8 +602,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -654,8 +648,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -679,7 +673,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -704,7 +697,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -719,8 +712,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -794,7 +787,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -842,7 +834,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -876,6 +867,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -887,15 +882,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -957,7 +948,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_available_endpoint_services_operations_async.py index 10da2d441769..927b4f677c64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_bgp_service_communities_operations_async.py index 5d8f74ee176c..7a80616330c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_default_security_rules_operations_async.py index 4ffae71b452f..5f9c9ee056a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index a9e24d8f08e8..a30b52984976 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index c238f83e2059..d05943f254a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuits_operations_async.py index 7d7071db4377..70b152eed263 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -327,8 +323,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -352,7 +348,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -378,7 +373,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -396,8 +391,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -448,8 +443,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -473,7 +468,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -499,7 +493,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -517,8 +511,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -569,8 +563,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -594,7 +588,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -620,7 +613,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -638,8 +631,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -722,7 +715,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -782,7 +774,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -819,6 +810,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -831,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -883,6 +874,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -894,15 +889,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_service_providers_operations_async.py index df5c4f3cb421..0390632f3c93 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py index d00ab0446da4..10a5c2cb1acd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 796ed8f861d8..b54237e39d31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 8b9e46f634f4..4d1db845a16f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index b90cd4135fa6..9dcaa6c9f60b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 591e9540919d..548e739c8262 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_probes_operations_async.py index 03b8e72d467e..746af743df3c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancers_operations_async.py index 89aa01ce7357..027174920390 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_local_network_gateways_operations_async.py index 8cd64a7c0f11..aad513403bc6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index cc1a25bd1c6f..0755400736a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index cc49cee135b7..d8e0137f2e63 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interfaces_operations_async.py index 5e8d01f9de44..63c7dc472cf6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -460,8 +456,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -483,7 +479,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -507,7 +502,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -520,8 +515,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -568,8 +563,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -591,7 +586,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -615,7 +609,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -628,8 +622,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -698,6 +692,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -712,15 +710,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -770,6 +764,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -783,15 +781,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -870,7 +864,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_management_client_operations_async.py index 3b67271b5db3..23256ab579b4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_security_groups_operations_async.py index 603a8b31f251..6beea124ef1b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -343,6 +339,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -354,15 +354,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -421,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_watchers_operations_async.py index 345ea012c26c..452ba411362e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -288,6 +284,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -300,15 +300,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -352,6 +348,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,7 +438,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -494,7 +489,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -507,7 +501,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -526,7 +519,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -541,8 +534,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -616,7 +609,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -629,7 +621,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -648,7 +639,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -663,8 +654,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -738,7 +729,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -751,7 +741,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -770,7 +759,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -785,8 +774,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -860,7 +849,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -873,7 +861,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -892,7 +879,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -907,8 +894,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -982,7 +969,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -995,7 +981,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1014,7 +999,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1029,8 +1014,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1104,7 +1089,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1117,7 +1101,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1136,7 +1119,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": + ) -> AsyncLROPoller["models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1151,8 +1134,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1226,7 +1209,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1239,7 +1221,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1258,7 +1239,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1273,8 +1254,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1348,7 +1329,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1361,7 +1341,6 @@ async def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1380,7 +1359,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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. @@ -1396,8 +1375,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_packet_captures_operations_async.py index d9eb67876dea..cc96ac8f5a99 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_public_ip_addresses_operations_async.py index e182bfb8e29f..2379a77c9673 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -478,6 +474,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -491,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -559,6 +555,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -575,15 +575,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -670,7 +666,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_filter_rules_operations_async.py index adb0defcfe03..5444746cd244 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_filters_operations_async.py index 95582f494162..9043c8bfbf0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_tables_operations_async.py index f266c9e54f3b..9c408dee934b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_routes_operations_async.py index 3c069d53dbcc..2c46ea00e51a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_security_rules_operations_async.py index 449498e7a30b..9a9c19888dc9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_subnets_operations_async.py index 55183e81a8f3..8897870d759a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_usages_operations_async.py index c61b76498c13..21bdb09964f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 4f786bb476c9..c1a3b64feb2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -368,7 +363,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -387,7 +381,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -405,8 +399,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -490,7 +484,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -528,6 +521,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -540,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +574,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -606,7 +599,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -635,7 +627,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -654,8 +646,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py index f9ffa4a90070..abc46c70fa26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -340,6 +336,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -410,6 +406,10 @@ def list_connections( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -423,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -464,8 +460,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -489,7 +485,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -514,7 +509,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -530,8 +525,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -580,8 +575,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -605,7 +600,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -634,7 +628,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -651,8 +645,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -701,8 +695,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -726,7 +720,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -755,7 +748,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -772,8 +765,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -821,8 +814,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -844,7 +837,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -868,7 +860,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -882,8 +874,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -931,8 +923,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -956,7 +948,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -981,7 +972,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -996,8 +987,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1045,8 +1036,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -1068,7 +1059,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1092,7 +1082,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1106,8 +1096,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1155,8 +1145,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -1179,7 +1169,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1204,7 +1193,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1220,8 +1209,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 354f94db0817..64947ad3f511 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_networks_operations_async.py index 0e245603254b..e041d98654b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -342,6 +338,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -353,15 +353,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -408,6 +404,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -499,7 +495,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -539,6 +534,10 @@ def list_usage( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -552,15 +551,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 ca358e728d18..b6c761e0ec26 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -489,7 +485,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -509,7 +504,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -590,7 +585,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,7 +604,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -670,8 +664,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -695,7 +689,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -721,7 +714,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -812,7 +805,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -861,7 +853,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -896,6 +887,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -907,15 +902,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -978,7 +969,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 30a6ca537003..9b52c86ed583 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0a20b20d8406..bd2330e06b60 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ba6d5f58f517..77c20dbf2c5a 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ee60239c093d..7e1f17ca5e7b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6f0d3705e61f..baba89668a8f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2edbab7cfae8..6134a8de1355 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -337,8 +333,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -362,7 +358,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -389,7 +384,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -460,8 +455,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -485,7 +480,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,7 +506,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -583,8 +577,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -608,7 +602,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -635,7 +628,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -738,7 +731,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -799,7 +791,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -837,6 +828,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -849,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -902,6 +893,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -913,15 +908,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d411ec808bdb..9ef7f19dc6a5 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1ecd3a96c256..bd4bbbe5114d 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 @@ -71,6 +71,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 e7336ccea62b..9a23664906df 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 20c08b15a646..9af821530664 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 16d31c02e16a..1e29b836a6ec 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 71cf2db5c49f..f561f7bb3a43 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7d4f290a34c8..c5709027f01f 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 030799b20f04..a5d5746642d9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 76498b574c76..147c0e9b6cd7 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 75d6f13041d6..45458ee131fa 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 03470448ef52..c3e7fc4248f6 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ed0e290fe17f..96641ca20bad 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -472,8 +468,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -495,7 +491,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -520,7 +515,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -582,8 +577,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -605,7 +600,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -630,7 +624,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -714,6 +708,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -728,15 +726,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -787,6 +781,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -800,15 +798,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -888,7 +882,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 94a55e0ea2f0..58dc11b1b43c 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 9eb9a989ec5e..85689b491d30 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -353,6 +349,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -364,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -432,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f3d464b096ef..dbc9f85e1165 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -297,6 +293,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -309,15 +309,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -362,6 +358,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,7 +449,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -506,7 +501,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -519,7 +513,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -539,7 +532,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -630,7 +623,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -643,7 +635,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -663,7 +654,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -754,7 +745,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -767,7 +757,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -787,7 +776,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -878,7 +867,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -891,7 +879,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -911,7 +898,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1002,7 +989,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1015,7 +1001,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1035,7 +1020,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1126,7 +1111,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1139,7 +1123,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1159,7 +1142,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1250,7 +1233,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1263,7 +1245,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1283,7 +1264,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1374,7 +1355,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1387,7 +1367,6 @@ def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1407,7 +1386,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 90f7c84a13fa..9a478e07ef3d 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5886ff40768b..b3e3219f2a11 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -490,6 +486,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -503,15 +503,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -572,6 +568,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -588,15 +588,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -684,7 +680,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 56b11c186957..e7e79c42911e 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cb52f2dc04a4..040367d0c545 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9ea11d399e30..4369829c39fd 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 567f18e99279..c26cdbb053fc 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fe39d499eeb4..59a0455b5ddb 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 42534f5fd8ad..71343dba68c1 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5410e9ef4162..dd9696ca5824 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 93fe194a6e0c..f7e8e49dac17 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -378,7 +373,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -398,7 +392,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -502,7 +496,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -541,6 +534,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -553,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +588,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -620,7 +613,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -650,7 +642,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 8de05bddd485..a24c53089c98 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -421,6 +417,10 @@ def list_connections( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -434,15 +434,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -476,8 +472,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -501,7 +497,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -527,7 +522,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -594,8 +589,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -619,7 +614,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -649,7 +643,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -717,8 +711,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -742,7 +736,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -772,7 +765,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -839,8 +832,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -862,7 +855,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -887,7 +879,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -951,8 +943,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -976,7 +968,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1002,7 +993,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1067,8 +1058,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -1090,7 +1081,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1115,7 +1105,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1179,8 +1169,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-08-01" @@ -1203,7 +1193,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1229,7 +1218,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. 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 603c1e99c621..bf7006f30316 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a67f1452ca40..ea4dad7146e5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -352,6 +348,10 @@ def list_all( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -363,15 +363,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -419,6 +415,10 @@ def list( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -511,7 +507,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -552,6 +547,10 @@ def list_usage( api_version = "2017-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -565,15 +564,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0fbf3dd4c6b1..2f3761d6b029 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 @@ -84,11 +84,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -96,6 +94,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_application_gateways_operations_async.py index 7c585ed893b2..5b298b67f242 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_application_security_groups_operations_async.py index 4b08347d1b39..84e3bb490b5a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_available_endpoint_services_operations_async.py index 2ccd5a2a316d..f2d79c2d70c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_bgp_service_communities_operations_async.py index 8e7fde3c2913..824345b0d8f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_default_security_rules_operations_async.py index 61957ebab4c6..f3b916901b11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 9b1b62146dbf..a6881f29b254 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 6f21b448f219..1cafdc411603 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuits_operations_async.py index 284ce05c775b..a561302a908d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_service_providers_operations_async.py index cbc0fd5d3dd9..c8066271f455 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_inbound_nat_rules_operations_async.py index fa33cd3e08a7..d065cddcb2af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 7a08e51bba70..e4407ece0ef0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 4331c2ed4e65..f237495ac664 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 96a1aa067aa1..2ea16cd48c5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 9bc2124bccd1..57c31a80899e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_probes_operations_async.py index b79160b88b40..2cdc9fca09dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancers_operations_async.py index ece15b674a6d..db03ed0639bc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_local_network_gateways_operations_async.py index 2178bd9bffbd..ca588800ea13 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 774ecbbb86b4..76666f9703f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index d83a93500509..d228a2d5ad47 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interfaces_operations_async.py index 1ab35dea9ff9..703ee2cee39d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_management_client_operations_async.py index e65cbb4cfef0..3708a9da946c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_security_groups_operations_async.py index 6e355960a5b7..ad5bec604189 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_watchers_operations_async.py index d20f11eceae2..6d43cf902311 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -312,7 +308,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -353,6 +348,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -365,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -417,6 +412,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -507,7 +502,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -559,7 +553,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -572,7 +565,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -591,7 +583,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -606,8 +598,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -681,7 +673,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -694,7 +685,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -713,7 +703,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -728,8 +718,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -803,7 +793,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -816,7 +805,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -835,7 +823,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -850,8 +838,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -925,7 +913,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -938,7 +925,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -957,7 +943,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -972,8 +958,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1047,7 +1033,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1060,7 +1045,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1079,7 +1063,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1094,8 +1078,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1169,7 +1153,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1182,7 +1165,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1201,7 +1183,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": + ) -> AsyncLROPoller["models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1216,8 +1198,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1291,7 +1273,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1304,7 +1285,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1323,7 +1303,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1338,8 +1318,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1413,7 +1393,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1426,7 +1405,6 @@ async def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1445,7 +1423,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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. @@ -1461,8 +1439,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1536,7 +1514,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1549,7 +1526,6 @@ async def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1568,7 +1544,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1584,8 +1560,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1659,7 +1635,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1672,7 +1647,6 @@ async def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1691,7 +1665,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1706,8 +1680,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_operations_async.py index 05436e0273b8..f224ac5b6723 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_packet_captures_operations_async.py index c4387f7f1f4d..c85673faf532 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_public_ip_addresses_operations_async.py index c6492ed06a3e..01081caa01e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_filter_rules_operations_async.py index d53a1de0db22..7d9c67cfbd8c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_filters_operations_async.py index 777723199a75..fb47f70e0ddc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_tables_operations_async.py index 1ec0c1efdc44..9d60de37d3e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_routes_operations_async.py index 494f90613942..8c58cbd34a5f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_security_rules_operations_async.py index 03cc7a0f180e..373b9a40dcfe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_subnets_operations_async.py index 05596782441c..4198d206a62f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_usages_operations_async.py index 3fd32e6377af..06fb3e5c3033 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 0ed19518653d..06e05fd796a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnectionListEntity, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionListEntity + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnectionListEntity or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionListEntity] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py index ed76bb3abc72..22eeaf578f68 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -697,8 +691,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -722,7 +716,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -751,7 +744,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -768,8 +761,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -818,8 +811,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -843,7 +836,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -889,8 +881,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -938,8 +930,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -961,7 +953,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -985,7 +976,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -999,8 +990,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1048,8 +1039,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -1073,7 +1064,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1098,7 +1088,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1113,8 +1103,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1196,7 +1186,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1218,8 +1207,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -1241,7 +1230,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1265,7 +1253,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1279,8 +1267,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1328,8 +1316,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -1352,7 +1340,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1377,7 +1364,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1393,8 +1380,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1482,7 +1469,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py index c37d42fbfdcf..2ea807907910 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_networks_operations_async.py index 08dd681cca6c..5c39bf304f9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_09_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -616,7 +611,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -656,6 +650,10 @@ def list_usage( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -669,15 +667,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 a3ea3c8bc6d4..33a69f882f19 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 0abe14aff06d..823d89af26d9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7b8d7c0182f4..d0d03a1d5469 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d58af6fcd758..0d88187ccf00 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f731abd403e3..51c1f4e6abda 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3ed165291dbd..03328464c81b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b52508c2faf9..8b5b5a09f1e6 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 895795de66d9..0f89f9175b06 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2e1270015bb0..0948f5a67f5f 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 476897baa8bc..a72eaa5490f5 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 @@ -71,6 +71,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 034341bea6ee..673984ea71fa 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 1c3c7e621677..a2ecc66d6db8 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 0a6c4abd7955..e6546ff6d60f 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 011fae0f3fb3..f11b8d98a20c 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fbb987bcd776..87234b9dc090 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 bd9f4a7671d6..6b2eacde5250 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1962f7dda741..a981f85a6770 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6467ff00737a..2a493a243e91 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 b4ea73a4bb73..bae5fc2b035e 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 58dc1302bab8..a71690de805b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 1fd966b1618b..38fed02aac3e 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a31c365b34d9..9c33314350a8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b35387b2d617..3e97a0285d4b 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -321,7 +317,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -363,6 +358,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +374,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -428,6 +423,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -439,15 +438,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -519,7 +514,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -572,7 +566,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -585,7 +578,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -605,7 +597,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -696,7 +688,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -709,7 +700,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -729,7 +719,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -820,7 +810,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -833,7 +822,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -853,7 +841,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -944,7 +932,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -957,7 +944,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -977,7 +963,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1068,7 +1054,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1081,7 +1066,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1101,7 +1085,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1192,7 +1176,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1205,7 +1188,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1225,7 +1207,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1316,7 +1298,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1329,7 +1310,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1349,7 +1329,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1440,7 +1420,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1453,7 +1432,6 @@ def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1473,7 +1451,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1565,7 +1543,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1578,7 +1555,6 @@ def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1598,7 +1574,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1690,7 +1666,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1703,7 +1678,6 @@ def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1723,7 +1697,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 c5add9aae6a7..2dac3949f4e6 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 775f0e4e841b..811d57bfc97a 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3de6936e6971..28ebfe700c0c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 db1709086d33..cb88691d24e1 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 33d66b418888..869fc53dc64c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dc56b6a225e7..1fd0721b21c1 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4ab52efbd5fd..2650445ecd82 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f6a93e70188f..d9e5bd0fd6a4 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 073b95123019..36ccf654931b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 990657fb594c..60e61c14c1cc 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dced3a56b1cb..74d100508397 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 0143e7a5276c..6e8168f0d561 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -713,8 +707,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -738,7 +732,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -768,7 +761,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -836,8 +829,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -861,7 +854,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -891,7 +883,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -958,8 +950,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -981,7 +973,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +997,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1070,8 +1061,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -1095,7 +1086,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1121,7 +1111,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1220,7 +1210,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1243,8 +1232,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -1266,7 +1255,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1291,7 +1279,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1355,8 +1343,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-09-01" @@ -1379,7 +1367,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1405,7 +1392,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1511,7 +1498,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 d65b30024c6b..745de7adcd6b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7af01be5ba7d..b8830ab0d16f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -630,7 +625,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -671,6 +665,10 @@ def list_usage( api_version = "2017-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -684,15 +682,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 383bc261ec4f..bf515d6eed81 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 @@ -85,11 +85,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -97,6 +95,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_application_gateways_operations_async.py index 6b3876849e0b..d2b224694352 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_application_security_groups_operations_async.py index eaebd6e179d3..f6db7b83820c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_available_endpoint_services_operations_async.py index c4d8df76a355..9f3871cfa7ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_bgp_service_communities_operations_async.py index 456798efeeeb..6bd86e7f3b7e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_connection_monitors_operations_async.py index cfaa07de8dd0..90f6fde417a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -89,7 +88,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -109,7 +107,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -365,7 +361,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -385,7 +380,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -400,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +465,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -490,7 +484,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -505,8 +499,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +570,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -585,7 +578,6 @@ async def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -604,7 +596,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -619,8 +611,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,6 +678,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -699,15 +695,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_default_security_rules_operations_async.py index a225ea2547fd..0569e57be7bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 93245e040e2b..9b9427acb5fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index e12db12892ab..57440bd1d7a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuits_operations_async.py index e4b1d7fcc197..b9f1d42a5a42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_service_providers_operations_async.py index b882c212e76a..8ef81ddd059a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 6f501c51c74e..4d2fa887df11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index d7c81b8d30df..243509b06abc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index ccbca35c50cf..4f82266942ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index dc417e2b8f7d..f602c75d9c26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 16c11a694641..181c9e7107b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_probes_operations_async.py index 58328c461639..1ea87767184a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancers_operations_async.py index 5f396d7a9edd..d52eaa86e8e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_local_network_gateways_operations_async.py index 97a225047b81..6fc62c5e5d02 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 6ff6c7fe04c8..871c8a4f7d5c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index dc4df575d2be..1e78c2106d93 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interfaces_operations_async.py index 93f560102937..4739d35ce9e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_management_client_operations_async.py index 3bd76e0f6878..080a313a797e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_security_groups_operations_async.py index 320118514e2f..037380c59bee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_watchers_operations_async.py index 8745c61e5c29..63ec89d00f0a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -312,7 +308,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -353,6 +348,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -365,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -417,6 +412,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -507,7 +502,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -559,7 +553,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -572,7 +565,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -591,7 +583,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -606,8 +598,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -681,7 +673,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -694,7 +685,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -713,7 +703,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -728,8 +718,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -803,7 +793,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -816,7 +805,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -835,7 +823,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -850,8 +838,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -925,7 +913,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -938,7 +925,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -957,7 +943,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -972,8 +958,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1047,7 +1033,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1060,7 +1045,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1079,7 +1063,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1094,8 +1078,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1169,7 +1153,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1182,7 +1165,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1201,7 +1183,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": + ) -> AsyncLROPoller["models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1216,8 +1198,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1291,7 +1273,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1304,7 +1285,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1323,7 +1303,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1338,8 +1318,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1413,7 +1393,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1426,7 +1405,6 @@ async def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1445,7 +1423,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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. @@ -1461,8 +1439,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1536,7 +1514,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1549,7 +1526,6 @@ async def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1568,7 +1544,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1584,8 +1560,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1659,7 +1635,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1672,7 +1647,6 @@ async def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1691,7 +1665,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1706,8 +1680,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_operations_async.py index 58197fa0b694..3041300d4b0f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_packet_captures_operations_async.py index dd1cfcb0a67c..cc2876958633 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_public_ip_addresses_operations_async.py index 4d8b9a4af84a..78b2bb49ee82 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_filter_rules_operations_async.py index 0e96c50b6305..a1c5331c394d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_filters_operations_async.py index aab1a17eab50..7ca5d6ba3f53 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_tables_operations_async.py index eac395bf27be..a4779903b1e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_routes_operations_async.py index 4a2ab402bda9..23b3de3df929 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_security_rules_operations_async.py index a2111c365bf6..90c912f5abac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_subnets_operations_async.py index 071507c952d5..198ec895699c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_usages_operations_async.py index b6b6bbe8cef0..40200cc7409d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 3d2720fa4dd8..96b75020da21 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnectionListEntity, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionListEntity + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnectionListEntity or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionListEntity] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 1faac09207a7..b9439f30afdf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -697,8 +691,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -722,7 +716,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -751,7 +744,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -768,8 +761,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -818,8 +811,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -843,7 +836,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -889,8 +881,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -938,8 +930,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -961,7 +953,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -985,7 +976,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -999,8 +990,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1048,8 +1039,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -1073,7 +1064,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1098,7 +1088,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1113,8 +1103,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1196,7 +1186,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1218,8 +1207,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -1241,7 +1230,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1265,7 +1253,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1279,8 +1267,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1328,8 +1316,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -1352,7 +1340,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1377,7 +1364,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1393,8 +1380,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1482,7 +1469,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_peerings_operations_async.py index eee485c2e200..2f99034a9904 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_networks_operations_async.py index 9ffde70915e3..ee334c12bb6e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_10_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -616,7 +611,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -656,6 +650,10 @@ def list_usage( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -669,15 +667,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 086946f57d9f..d74798c5baa8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 720962a24a09..ed5fd61410bf 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6114eed2e5e4..f10d2cd44bef 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 366c0b7ce5f4..60a213229f7b 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 98121556c514..f058979fadc9 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -94,7 +93,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -115,7 +113,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -375,7 +371,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -396,7 +391,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -482,7 +477,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -503,7 +497,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -590,7 +584,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -599,7 +592,6 @@ def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -619,7 +611,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -702,6 +694,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -715,15 +711,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6c4a4769e21f..f0d8975699e2 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 450d6a819b7b..e0aca44da7af 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1cd7234f65f9..6d9c41fa8237 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8a2ce3710792..4589e66d1b7f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 54c6f7067dcc..07ebdae9691b 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 13bc162234f5..780e9f36c93e 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 @@ -71,6 +71,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 514e330d691d..54095bee0246 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 93408d58a62d..ae6a99db1917 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ee90a45331ac..93b76323bc5d 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 b427a8863e86..2816b9276abd 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9d5ac75648d9..82d80c626e5d 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 dd35ecf987e0..92d161b3db49 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b71e70cbbead..bb82a72f72f1 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7e792288c6c1..61bd8dd3667a 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 f992230704af..82e35822958c 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5f8cabb74dcf..639451ada214 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3c5e38f00b49..9cb056d07e7e 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 72c0c7eafd19..0c1df07f92a5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bfeeaae466fc..f8d5b829496d 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -321,7 +317,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -363,6 +358,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +374,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -428,6 +423,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -439,15 +438,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -519,7 +514,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -572,7 +566,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -585,7 +578,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -605,7 +597,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -696,7 +688,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -709,7 +700,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -729,7 +719,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -820,7 +810,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -833,7 +822,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -853,7 +841,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -944,7 +932,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -957,7 +944,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -977,7 +963,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1068,7 +1054,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1081,7 +1066,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1101,7 +1085,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1192,7 +1176,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1205,7 +1188,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1225,7 +1207,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1316,7 +1298,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1329,7 +1310,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1349,7 +1329,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1440,7 +1420,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1453,7 +1432,6 @@ def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1473,7 +1451,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1565,7 +1543,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1578,7 +1555,6 @@ def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1598,7 +1574,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1690,7 +1666,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1703,7 +1678,6 @@ def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1723,7 +1697,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 952cd638f3b8..5bb7c86c1606 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1ac1a2fad52e..3a302b3870ba 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9d5c9c660e7d..b682323bbd6f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c87aa79c1729..d50f0621b17f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 56439e49a857..857c148dfb1c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2de48f2fb700..cadaa56b10d8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 04b1e6c767e3..6ce961d45294 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3b5ec9cd7fbd..03a78430adb2 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0961ebf02aca..c160deb21b98 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bad3673283e7..6c9268a5c38b 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 71ea92cb58f4..20e28bae37f8 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 12a6b8fb9756..980ef756b8b8 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -713,8 +707,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -738,7 +732,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -768,7 +761,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -836,8 +829,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -861,7 +854,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -891,7 +883,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -958,8 +950,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -981,7 +973,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +997,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1070,8 +1061,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -1095,7 +1086,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1121,7 +1111,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1220,7 +1210,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1243,8 +1232,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -1266,7 +1255,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1291,7 +1279,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1355,8 +1343,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-10-01" @@ -1379,7 +1367,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1405,7 +1392,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1511,7 +1498,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 61dd246ee8ed..1f21b556b6fe 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aefe34842681..346731fc7778 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -630,7 +625,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -671,6 +665,10 @@ def list_usage( api_version = "2017-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -684,15 +682,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 66ccf4069953..155f093ef597 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 @@ -85,11 +85,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -97,6 +95,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_application_gateways_operations_async.py index 2861704bb923..bed4b1003abc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_application_security_groups_operations_async.py index 97da61611c36..9aa342bfa926 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_available_endpoint_services_operations_async.py index 7a569e345187..51fcc7f2700d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_bgp_service_communities_operations_async.py index 2143a5864daa..4587928d6e06 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_connection_monitors_operations_async.py index 4eac640aece0..0fe698fb19c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -89,7 +88,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -109,7 +107,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -365,7 +361,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -385,7 +380,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -400,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +465,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -490,7 +484,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -505,8 +499,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +570,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -585,7 +578,6 @@ async def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -604,7 +596,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -619,8 +611,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,6 +678,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -699,15 +695,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_default_security_rules_operations_async.py index 533ca409890b..33b9b573ead1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 1ed9122681b7..496b0ddae52a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 559c47986489..e614e156397d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuits_operations_async.py index bde6ce773130..626f26dd8305 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_service_providers_operations_async.py index 9fb641d580e6..66667b06df0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py index fa5ddf5cf5a3..1bc0b25a177f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index a0c1d4d76242..6ac1ed093fa0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 07bd49ba49d3..f7028ccccd9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 4ab68908a5d4..7d28f7c27d4d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 900700f9abce..71a375d2cf8c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_probes_operations_async.py index a215d0f44a05..5c3e27ab2b5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancers_operations_async.py index f2ab0210b3e5..2c9bd160fd92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_local_network_gateways_operations_async.py index 34cfabd47b3a..015f86106d58 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index caf5c5199af7..d4461322995a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index f087662f445b..bd046be36fd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interfaces_operations_async.py index 098fb4164325..9946ed3cf6eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_management_client_operations_async.py index 2980d322b263..16c3473f46ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_security_groups_operations_async.py index c42237c5def7..2717dc6ebed1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_watchers_operations_async.py index 24ba35f8c89b..99b26885c9f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -312,7 +308,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -353,6 +348,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -365,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -417,6 +412,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -507,7 +502,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -559,7 +553,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -572,7 +565,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -591,7 +583,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -606,8 +598,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -681,7 +673,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -694,7 +685,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -713,7 +703,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -728,8 +718,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -803,7 +793,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -816,7 +805,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -835,7 +823,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -850,8 +838,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -925,7 +913,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -938,7 +925,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -957,7 +943,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -972,8 +958,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1047,7 +1033,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1060,7 +1045,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1079,7 +1063,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1094,8 +1078,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1169,7 +1153,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1182,7 +1165,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1201,7 +1183,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": + ) -> AsyncLROPoller["models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1216,8 +1198,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1291,7 +1273,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1304,7 +1285,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1323,7 +1303,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1338,8 +1318,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1413,7 +1393,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1426,7 +1405,6 @@ async def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1445,7 +1423,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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. @@ -1461,8 +1439,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1536,7 +1514,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1549,7 +1526,6 @@ async def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1568,7 +1544,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1584,8 +1560,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1659,7 +1635,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1672,7 +1647,6 @@ async def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1691,7 +1665,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1706,8 +1680,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_operations_async.py index 2349bb89d67c..b032623aa9de 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_packet_captures_operations_async.py index 980291e0feec..54a712c6d8b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_public_ip_addresses_operations_async.py index 0667aa41a287..ec2835836598 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_filter_rules_operations_async.py index ec13885ab9cb..515c27de548f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_filters_operations_async.py index f161755f927f..d049048bdbd2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_tables_operations_async.py index a3dfe74abc12..d574acd323b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_routes_operations_async.py index 88cf6a008147..8e7a3b47d691 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_security_rules_operations_async.py index 553f262ee190..02c0bc83ffaa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_subnets_operations_async.py index c7321c7905a1..3bce99e652d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_usages_operations_async.py index 2c61e1c971ef..df2bd89b07c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 2ea71abce3e8..86cfd1594cd3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnectionListEntity, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionListEntity + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnectionListEntity or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionListEntity] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py index b60ebd19f2c4..a85d8dd879e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -697,8 +691,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -722,7 +716,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -751,7 +744,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -768,8 +761,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -818,8 +811,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -843,7 +836,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -889,8 +881,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -938,8 +930,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -961,7 +953,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -985,7 +976,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -999,8 +990,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1048,8 +1039,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -1073,7 +1064,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1098,7 +1088,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1113,8 +1103,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1196,7 +1186,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1218,8 +1207,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -1241,7 +1230,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1265,7 +1253,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1279,8 +1267,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1328,8 +1316,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -1352,7 +1340,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1377,7 +1364,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1393,8 +1380,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1482,7 +1469,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 96af251abcfb..695dc21f4278 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_networks_operations_async.py index fc31b021d285..601ae7ac0872 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_11_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_11_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -616,7 +611,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -656,6 +650,10 @@ def list_usage( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -669,15 +667,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 ff6df5f91b8c..8baa1a705e6f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3bd5265e5c3b..5f9544578e03 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c4995be4948e..0def087169fb 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8b2105ae75e5..bf51a9d4f2d4 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d7a43b6e9146..70cf5549d53e 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -94,7 +93,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -115,7 +113,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -375,7 +371,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -396,7 +391,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -482,7 +477,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -503,7 +497,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -590,7 +584,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -599,7 +592,6 @@ def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -619,7 +611,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -702,6 +694,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -715,15 +711,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 76a680e940dd..5d07168227e0 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e950005ad784..7e9ac4dbd5fc 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8f91241a9105..ca3083319961 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 46cb960bd919..594718756e82 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4c5bbfe5081c..ef149398ce2d 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5c8b21a92b54..b55c0416ea25 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 @@ -71,6 +71,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 a6a2bf6156cd..c4a9408a92bc 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 b189c54e04ab..e0b740abd627 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 633133266b09..9a3807adb72a 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 192c493569c8..376296c5cd84 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 db9cd74801b5..801f68e7d992 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d2967b62c2cc..cd0d261a0655 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0f5429d9e47a..cbd91c861c4b 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 747298c33632..8c2312dba932 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 42749b19bad5..bc0d34158c80 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 @@ -69,6 +69,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c9268f0792a5..61e965730e62 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 37c4e4116bca..90c1e63645fe 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e63c08b8923c..08a9adb80a8c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2e3fb94e3c9a..8b0aafb7e21a 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -321,7 +317,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -363,6 +358,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +374,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -428,6 +423,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -439,15 +438,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -519,7 +514,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -572,7 +566,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -585,7 +578,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -605,7 +597,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -696,7 +688,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -709,7 +700,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -729,7 +719,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -820,7 +810,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -833,7 +822,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -853,7 +841,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -944,7 +932,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -957,7 +944,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -977,7 +963,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1068,7 +1054,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1081,7 +1066,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1101,7 +1085,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1192,7 +1176,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1205,7 +1188,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1225,7 +1207,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1316,7 +1298,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1329,7 +1310,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1349,7 +1329,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1440,7 +1420,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1453,7 +1432,6 @@ def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1473,7 +1451,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1565,7 +1543,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1578,7 +1555,6 @@ def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1598,7 +1574,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1690,7 +1666,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1703,7 +1678,6 @@ def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1723,7 +1697,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 ac3c477b041d..30cac120a79e 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 @@ -63,6 +63,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 79f5057cbcd3..99e57fa1da5c 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 51cdf1f17982..8ca84452b32e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8a10a50f8441..37f759f1f77d 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f2429ee78313..480023278c4c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bedbd77a875b..2e43a7c56543 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ce0058e67586..5516f5d784e3 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 51bda1da6fd4..9de359fd27ca 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8cdc19fd90dc..12eb819dc2a5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ea2ce3b52ba1..948a2b718547 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 @@ -66,6 +66,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ebf3856c1d4a..289d6af28f9b 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 afc7241ab085..aa6290ab8b9a 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -713,8 +707,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -738,7 +732,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -768,7 +761,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -836,8 +829,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -861,7 +854,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -891,7 +883,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -958,8 +950,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -981,7 +973,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +997,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1070,8 +1061,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -1095,7 +1086,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1121,7 +1111,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1220,7 +1210,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1243,8 +1232,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -1266,7 +1255,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1291,7 +1279,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1355,8 +1343,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01" @@ -1379,7 +1367,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1405,7 +1392,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1511,7 +1498,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 b87b6e17cd66..430d403824e1 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 07095b06a554..4fa8721bfe21 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -630,7 +625,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -671,6 +665,10 @@ def list_usage( api_version = "2017-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -684,15 +682,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 195e60c951ec..4712b4e60142 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 @@ -85,11 +85,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -97,6 +95,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_application_gateways_operations_async.py index 1862ab5d2633..aac844c63a5a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_application_security_groups_operations_async.py index 8532900cc576..202bed26792e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_available_endpoint_services_operations_async.py index eb8ee6b88eda..63cec13b7782 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_bgp_service_communities_operations_async.py index e6ed20c633da..5853fced0c25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_connection_monitors_operations_async.py index 037b484e50a0..010c92209216 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -89,7 +88,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -109,7 +107,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -365,7 +361,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -385,7 +380,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -400,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +465,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -490,7 +484,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -505,8 +499,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +570,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -585,7 +578,6 @@ async def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -604,7 +596,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -619,8 +611,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,6 +678,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -699,15 +695,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_default_security_rules_operations_async.py index a898a5e70e38..9f4a999f54c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 9ee5f1cd19ed..47346276bf74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 6a4314fd9f1d..6c44fec59fbd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuits_operations_async.py index e2581d1feb7f..a91257fe9ee9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_service_providers_operations_async.py index e7271265bd1a..855fb6eeef4a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 8fa93ed50d9f..abc5c1226cd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index e607898cf404..bcfa191ab276 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index fedc0c65b72c..51ac25b7e962 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 2e1edc516ba6..20ac809460fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index c1ef15f9d85f..1c10d9763b78 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_probes_operations_async.py index 8ac8b2630c65..d4a07a8c0ffe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancers_operations_async.py index bda74805dfe4..f9e641b71991 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_local_network_gateways_operations_async.py index 91f4a4b6e7d7..958abf099d8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index bb12e73a272e..87f12e21ccf6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index b744e91b7f80..882128e79387 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interfaces_operations_async.py index f559bc05d06f..83fe906d2bf1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_management_client_operations_async.py index f3a2e12a63ce..b0a9ea697388 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_security_groups_operations_async.py index 261fa1ea1117..ef43ce99e07a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_watchers_operations_async.py index aafb037098e4..0eeb2c1c4f09 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -312,7 +308,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -353,6 +348,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -365,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -417,6 +412,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -507,7 +502,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -559,7 +553,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -572,7 +565,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -591,7 +583,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -606,8 +598,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -681,7 +673,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -694,7 +685,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -713,7 +703,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -728,8 +718,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -803,7 +793,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -816,7 +805,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -835,7 +823,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -850,8 +838,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -925,7 +913,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -938,7 +925,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -957,7 +943,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -972,8 +958,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1047,7 +1033,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1060,7 +1045,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1079,7 +1063,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1094,8 +1078,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1169,7 +1153,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1182,7 +1165,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1201,7 +1183,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1216,8 +1198,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1291,7 +1273,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1304,7 +1285,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1323,7 +1303,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1339,8 +1319,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1414,7 +1394,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1427,7 +1406,6 @@ async def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1446,7 +1424,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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. @@ -1462,8 +1440,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1537,7 +1515,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1550,7 +1527,6 @@ async def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1569,7 +1545,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1585,8 +1561,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1660,7 +1636,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1673,7 +1648,6 @@ async def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1692,7 +1666,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1707,8 +1681,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_operations_async.py index ee6c7d5cdd4b..c5e13d612492 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_packet_captures_operations_async.py index 8b9dc4ac6a46..8f5352513d9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_public_ip_addresses_operations_async.py index 843896eccae0..422abf52568a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_filter_rules_operations_async.py index 441acfead972..8db51d775f08 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_filters_operations_async.py index 04500455b78a..ac041c6f8980 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_tables_operations_async.py index b6b4ef92819f..540d8374d146 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_routes_operations_async.py index 0bdbcc973c2b..8c0d22418ab5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_security_rules_operations_async.py index f07b2d5b9259..d620dcc73543 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_subnets_operations_async.py index 07f0a88611b3..721808bacc34 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_usages_operations_async.py index 8f5e2c03a53d..1d3181f70f4b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 3bee9218060e..aabbb8eceef5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnectionListEntity, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionListEntity + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnectionListEntity or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionListEntity] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_gateways_operations_async.py index da5ec1d198ee..1c0de4faf258 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -697,8 +691,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -722,7 +716,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -751,7 +744,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -768,8 +761,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -818,8 +811,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -843,7 +836,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -889,8 +881,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -938,8 +930,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -961,7 +953,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -985,7 +976,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -999,8 +990,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1048,8 +1039,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -1073,7 +1064,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1098,7 +1088,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1113,8 +1103,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1196,7 +1186,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1218,8 +1207,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -1241,7 +1230,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1265,7 +1253,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1279,8 +1267,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1328,8 +1316,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -1352,7 +1340,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1377,7 +1364,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1393,8 +1380,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1482,7 +1469,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_peerings_operations_async.py index cdb7707e9d01..9cc829e7aa8d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_networks_operations_async.py index 72d626dabcb1..07dea8250852 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -616,7 +611,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -656,6 +650,10 @@ def list_usage( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -669,15 +667,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 5cfe4fc425be..6adc2754c0e5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 fb64c90eef75..cd3c60e3fdb0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3a195390a9a0..3a6a1d91921c 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dd5ebd398f26..cb376612a1c1 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d7b935456b04..e6a63f909c41 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -94,7 +93,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -115,7 +113,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -375,7 +371,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -396,7 +391,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -482,7 +477,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -503,7 +497,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -590,7 +584,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -599,7 +592,6 @@ def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -619,7 +611,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -702,6 +694,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -715,15 +711,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 19a9859b6858..15e3696f1130 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 b428538a8972..d3050003d5a0 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e269af6ab682..f55e373da7aa 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0fa037d3026a..77b3f48a773d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9835523c1f02..92b335936af8 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 75c753a49539..2db04f8f9559 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 94bc06932967..028076b15233 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 9f8f282b4491..b9dd11414669 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3928a2a100b8..c3edb5fa6ea2 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d0f85b1755a3..9ecf193f24a5 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 463345d4fe7e..1102d798f373 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 b4530a5f6e8d..33141a96d1be 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c9391df8ce3e..dd9f032ca929 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 863af9519889..a8b091c418eb 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 de5b245d465a..38cff1b24f5a 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7df7e0c5a5ab..b33a8d156e58 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 98f58c2b7006..3d1bead4418f 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a4e1eb1d3ca6..89ad5c9a525b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a794908da83a..145121cc08e8 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -321,7 +317,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -363,6 +358,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +374,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -428,6 +423,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -439,15 +438,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -519,7 +514,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -572,7 +566,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -585,7 +578,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -605,7 +597,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -696,7 +688,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -709,7 +700,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -729,7 +719,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -820,7 +810,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -833,7 +822,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -853,7 +841,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -944,7 +932,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -957,7 +944,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -977,7 +963,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1068,7 +1054,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1081,7 +1066,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1101,7 +1085,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1192,7 +1176,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1205,7 +1188,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1225,7 +1207,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1316,7 +1298,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1329,7 +1310,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1349,7 +1329,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1441,7 +1421,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1454,7 +1433,6 @@ def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1474,7 +1452,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1566,7 +1544,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1579,7 +1556,6 @@ def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1599,7 +1575,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1691,7 +1667,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1704,7 +1679,6 @@ def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1724,7 +1698,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 c85be6cf9709..ff50e344c7cd 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d407af178752..62ad3664b16b 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 16a9d0b6af3b..a7f657294f25 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 19d5e3802652..fab113751220 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9160dc352d63..605815e66756 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c72894a0585c..0ef44281fc35 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e3b2d8b3ac4d..7f57d32f9611 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6d47222df36f..057025e5dc10 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3dde30ce9be1..755aec01abdc 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3fe6f9cfefce..fb80ee40231b 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 691de78f913c..3f5e9f29bb8f 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 cf2dfe210798..c291ae48176b 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -713,8 +707,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -738,7 +732,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -768,7 +761,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -836,8 +829,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -861,7 +854,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -891,7 +883,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -958,8 +950,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -981,7 +973,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +997,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1070,8 +1061,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -1095,7 +1086,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1121,7 +1111,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1220,7 +1210,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1243,8 +1232,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -1266,7 +1255,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1291,7 +1279,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1355,8 +1343,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" @@ -1379,7 +1367,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1405,7 +1392,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1511,7 +1498,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 6ac34ed0e1e2..ed808792aec2 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e1d0f1d5adf0..4b1fb5853b76 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -630,7 +625,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -671,6 +665,10 @@ def list_usage( api_version = "2018-01-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -684,15 +682,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f4f1e891a4ac..dd8f948a866c 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 @@ -89,11 +89,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -101,6 +99,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_application_gateways_operations_async.py index 34194fbb337b..827f7621663a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_application_security_groups_operations_async.py index fa38a3e938a8..38c8a74b6a31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_available_endpoint_services_operations_async.py index 486d99d484a6..1ff267635f6a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_bgp_service_communities_operations_async.py index 9e51fa00db04..074d73d52404 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_connection_monitors_operations_async.py index 6a5e7899dd26..7a702466d23b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -89,7 +88,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -109,7 +107,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -365,7 +361,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -385,7 +380,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -400,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +465,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -490,7 +484,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -505,8 +499,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +570,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -585,7 +578,6 @@ async def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -604,7 +596,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -619,8 +611,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,6 +678,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -699,15 +695,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_ddos_protection_plans_operations_async.py index 021b4e00cde1..f356d9931633 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_default_security_rules_operations_async.py index 3f1908df4770..413cd6d3f3c0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 9432312b2c07..0447e4815f95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index 5ee0b7628ee9..048490fdc24e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -73,7 +73,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -112,8 +111,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -201,7 +200,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -253,7 +251,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -266,7 +263,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -287,7 +283,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -307,8 +303,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index f2fbb91d7014..cbd392e60a49 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuits_operations_async.py index 8ecf4dcfe710..f1b35db96d95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index 71c26e2e04c7..fc125e9dae3f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 0d597eda616d..bada186f5e68 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_service_providers_operations_async.py index 3babff5943cd..8566ff6763af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_inbound_nat_rules_operations_async.py index f4aa943848c2..05edae9c3a46 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index e68a6d7df3b6..da0d548c739e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 4005b5fabd76..d930029bbd30 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 0bfb17092066..1fff17017d92 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 7ed620248865..d4f143a31850 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_probes_operations_async.py index 8a05efdd4c08..ac6b10dcc0ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancers_operations_async.py index d422971151f7..8a1b252d2e22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_local_network_gateways_operations_async.py index 0b8f976b9d37..598fd31a3c6b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index b2218bec4e09..e6b542fe88f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index 8ceb366967a6..594772ab5514 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interfaces_operations_async.py index e094d21e9439..699dd1410538 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_management_client_operations_async.py index 0f62bdbf7296..ac31150b44aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_security_groups_operations_async.py index a933edb8bf6c..5a0a908a6763 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_watchers_operations_async.py index ea98306d5bb6..9e2ac661b9f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -312,7 +308,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -353,6 +348,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -365,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -417,6 +412,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -507,7 +502,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -559,7 +553,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -572,7 +565,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -591,7 +583,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -606,8 +598,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -681,7 +673,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -694,7 +685,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -713,7 +703,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -728,8 +718,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -803,7 +793,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -816,7 +805,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -835,7 +823,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -850,8 +838,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -925,7 +913,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -938,7 +925,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -957,7 +943,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -972,8 +958,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1047,7 +1033,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1060,7 +1045,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1079,7 +1063,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1094,8 +1078,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1169,7 +1153,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1182,7 +1165,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1201,7 +1183,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "models.FlowLogInformation": + ) -> AsyncLROPoller["models.FlowLogInformation"]: """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1216,8 +1198,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1291,7 +1273,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1304,7 +1285,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1323,7 +1303,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1338,8 +1318,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1413,7 +1393,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1426,7 +1405,6 @@ async def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1445,7 +1423,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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. @@ -1461,8 +1439,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1536,7 +1514,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1549,7 +1526,6 @@ async def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1568,7 +1544,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1584,8 +1560,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1659,7 +1635,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1672,7 +1647,6 @@ async def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1691,7 +1665,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1706,8 +1680,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_operations_async.py index 0674b814d852..db801011d014 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_packet_captures_operations_async.py index fc8a27175412..a9d6912ad77d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_public_ip_addresses_operations_async.py index 4c9aeb09344d..9428c83c06f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_filter_rules_operations_async.py index 26c92cf15c06..1c6ef7847715 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_filters_operations_async.py index 20a4c4e2a433..9988c1987fa3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_tables_operations_async.py index 82a75497ad54..8ae954b144b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_routes_operations_async.py index 53f993193f5b..bf1262c56f5e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_security_rules_operations_async.py index 2d2f5b8509ed..462f172d5b00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_subnets_operations_async.py index f3a83971d2ba..8db8d888cdd9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_usages_operations_async.py index 34bc8bb7c83a..b00246d7440a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index f39432fddad1..6b39b5a7ab7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnectionListEntity": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnectionListEntity"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnectionListEntity, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayConnectionListEntity + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnectionListEntity or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGatewayConnectionListEntity] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 756ac26bf41a..ce4ba3801681 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -697,8 +691,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -722,7 +716,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -751,7 +744,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -768,8 +761,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -818,8 +811,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -843,7 +836,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -889,8 +881,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -938,8 +930,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -961,7 +953,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -985,7 +976,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -999,8 +990,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1048,8 +1039,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -1073,7 +1064,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1098,7 +1088,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1113,8 +1103,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1196,7 +1186,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1218,8 +1207,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -1241,7 +1230,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1265,7 +1253,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1279,8 +1267,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1328,8 +1316,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -1352,7 +1340,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1377,7 +1364,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1393,8 +1380,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1443,8 +1430,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -1468,7 +1455,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1497,7 +1483,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1514,8 +1500,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1586,7 +1572,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1608,7 +1593,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1623,8 +1608,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1711,7 +1696,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_peerings_operations_async.py index f781f0a5915d..d9221a71a606 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_networks_operations_async.py index 49e605be1137..3b23a11520a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_02_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_02_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -616,7 +611,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -656,6 +650,10 @@ def list_usage( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -669,15 +667,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 37f037a23c8f..996a338152ac 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 27ede5cba398..969709f6bca4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ac0d5df67be6..addbb3b98999 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b57c76a92b56..ac579f2ff302 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 810a742e1d4a..102eb4857858 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -94,7 +93,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -115,7 +113,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -375,7 +371,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -396,7 +391,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -482,7 +477,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -503,7 +497,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -590,7 +584,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -599,7 +592,6 @@ def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -619,7 +611,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -702,6 +694,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -715,15 +711,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fb6528443365..7de2d864e0ce 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fbd5194254e4..e08bc0342f6d 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 74acfc731bdf..50d9d14112b5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c0458bc6001d..99c28d332993 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 @@ -78,7 +78,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -208,7 +207,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -261,7 +259,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -274,7 +271,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -296,7 +292,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 529a7f95af32..ac4dc434badd 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a688814f7ce3..647cfd3164b9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 24ba3a75ebc9..4117dd5129b2 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 0eef5bfd8b01..2174dad38634 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 3e2c02726366..b342830870ab 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dfbb4bfd0fae..f1664c5516b7 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 8a6dff39e6a0..98b850fc1b3f 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 7cdf5af9846a..ab828c5ca2ef 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8d8dedff8830..97b8b09269ee 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 698c48a149cc..b37476b31afe 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 93ffd0446730..3ad487013691 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5264b231e3dd..433ce7b4144d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 30fddb6c3e43..6c91ad78d24a 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5fee6845a40d..f9497ea88b66 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 6ea9b716c3bf..c8ddc506320a 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ee4968767219..9c55ad137ef1 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e6351ca3c0ac..eab37b338cc6 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 4fb22dc2e7f6..4df48791a399 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 419a92649231..96d462609449 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -321,7 +317,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -363,6 +358,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +374,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -428,6 +423,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -439,15 +438,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -519,7 +514,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -572,7 +566,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -585,7 +578,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -605,7 +597,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -696,7 +688,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -709,7 +700,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -729,7 +719,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -820,7 +810,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -833,7 +822,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -853,7 +841,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -944,7 +932,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -957,7 +944,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -977,7 +963,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1068,7 +1054,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1081,7 +1066,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1101,7 +1085,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1192,7 +1176,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1205,7 +1188,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1225,7 +1207,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FlowLogInformation"] """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource group. @@ -1316,7 +1298,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1329,7 +1310,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1349,7 +1329,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1440,7 +1420,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1453,7 +1432,6 @@ def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1473,7 +1451,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1565,7 +1543,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1578,7 +1555,6 @@ def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1598,7 +1574,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1690,7 +1666,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1703,7 +1678,6 @@ def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1723,7 +1697,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 d618eecc1122..0b2769d9d934 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e847b0f1b758..00e1326244a8 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2884bed5c274..0e8d8f641805 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 87b1b0774e9e..277e1d083970 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3cfdd5559edc..ba8250de3f93 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 28b796ade742..4cdb23881938 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3033cdf61a9d..e8effb1d0d92 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 95cc8840c90f..3583690ca00d 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2fe91ff422e8..98e6e94ce7a5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c3ad547288c1..f4e40cf49661 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 13c66050cc6c..c1d49961bdfa 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnectionListEntity"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 e58d53feb761..5833b181d42c 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -713,8 +707,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -738,7 +732,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -768,7 +761,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -836,8 +829,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -861,7 +854,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -891,7 +883,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -958,8 +950,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -981,7 +973,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +997,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1070,8 +1061,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -1095,7 +1086,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1121,7 +1111,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1220,7 +1210,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1243,8 +1232,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -1266,7 +1255,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1291,7 +1279,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1355,8 +1343,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -1379,7 +1367,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1405,7 +1392,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1472,8 +1459,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-02-01" @@ -1497,7 +1484,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1527,7 +1513,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1617,7 +1603,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1640,7 +1625,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1744,7 +1729,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 61e6a05cd14b..8858054474db 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 62310dd98a7c..d3189c2fe05a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -630,7 +625,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -671,6 +665,10 @@ def list_usage( api_version = "2018-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -684,15 +682,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 46f23b4848b1..3e543fa7424d 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 @@ -97,11 +97,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -109,6 +107,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_application_gateways_operations_async.py index c5afc74cf749..76d98c193bb2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_application_security_groups_operations_async.py index 2d99221095cd..5daeddac0038 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_available_endpoint_services_operations_async.py index a8664e36ca32..42c44f88f817 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_azure_firewalls_operations_async.py index 7e68fa3a6272..fcc8e7ad233e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_bgp_service_communities_operations_async.py index 2404585d3699..5a4aeae8d52e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_connection_monitors_operations_async.py index 501c5a5090a0..94e2d7ff0d55 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -89,7 +88,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -109,7 +107,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -365,7 +361,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -385,7 +380,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -400,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +465,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -490,7 +484,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -505,8 +499,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -576,7 +570,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -585,7 +578,6 @@ async def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -604,7 +596,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -619,8 +611,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,6 +678,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -699,15 +695,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py index ce4e24fe5692..6b65b126ebc5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_default_security_rules_operations_async.py index d3b03c3d1bfa..750b509bf187 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 9ccf9d0cc9ac..e29d5cf5410f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index 9beac15e20df..4f24c7a1b1ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -73,7 +73,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -112,8 +111,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -201,7 +200,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -253,7 +251,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -266,7 +263,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -287,7 +283,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -307,8 +303,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 5e7847f411ac..9c7c56448259 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuits_operations_async.py index e6f1566187a6..59b14b89e768 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index 49eca2e7a147..a2928260cff2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 4c258706b46d..436c0b0a0fb8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_service_providers_operations_async.py index 7f02d63c96a1..fd8add08242b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index f07a70e211f6..3545dcdd7ea9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 76eac611bd7a..b42c324bdd52 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index fcb7d146ca14..d27dab1133b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index ed871fccf220..f49eda1dd5a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 5f9575542dc0..c5f4bfa9fe69 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 7672d0270661..0d9d064b8b25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_probes_operations_async.py index 4d02d3895358..3e96311215e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancers_operations_async.py index b385417bde25..cbcaf45ca321 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_local_network_gateways_operations_async.py index 09f0238e1aa6..ebb7c6d10397 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index b4012cd0f1d3..074cd28af78a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index 0ea7ca97b4d0..b187d6bdfec9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interfaces_operations_async.py index 86a570715171..36980f393a91 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_management_client_operations_async.py index 94968560c91e..57a9ae48b447 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_security_groups_operations_async.py index 05cc9c577a8b..60f0ddf66006 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_watchers_operations_async.py index 720effe1fa2a..5e5507436434 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -100,7 +99,6 @@ async def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -152,7 +150,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -196,7 +193,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -215,7 +211,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -228,8 +224,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -312,7 +308,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -353,6 +348,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -365,15 +364,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -417,6 +412,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -507,7 +502,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -559,7 +553,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -572,7 +565,6 @@ async def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -591,7 +583,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -606,8 +598,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -681,7 +673,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -694,7 +685,6 @@ async def _get_next_hop_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('NextHopResult', pipeline_response) @@ -713,7 +703,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -728,8 +718,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -803,7 +793,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -816,7 +805,6 @@ async def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -835,7 +823,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -850,8 +838,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -925,7 +913,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -938,7 +925,6 @@ async def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -957,7 +943,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -972,8 +958,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1047,7 +1033,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1060,7 +1045,6 @@ async def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1079,7 +1063,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1094,8 +1078,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1169,7 +1153,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1182,7 +1165,6 @@ async def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1201,7 +1183,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1216,8 +1198,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1291,7 +1273,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1304,7 +1285,6 @@ async def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1323,7 +1303,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1339,8 +1319,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1414,7 +1394,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1427,7 +1406,6 @@ async def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1446,7 +1424,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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. @@ -1462,8 +1440,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1537,7 +1515,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1550,7 +1527,6 @@ async def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1569,7 +1545,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1585,8 +1561,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1660,7 +1636,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1673,7 +1648,6 @@ async def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1692,7 +1666,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1707,8 +1681,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_operations_async.py index 828af7e9978b..87564b6a9750 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_packet_captures_operations_async.py index a33e92589378..265d2159840d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -104,7 +103,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -121,8 +120,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -209,7 +208,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -255,7 +253,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -275,7 +272,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -290,8 +287,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,7 +357,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -380,7 +376,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -395,8 +391,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,7 +462,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -475,7 +470,6 @@ async def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -494,7 +488,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -509,8 +503,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -576,6 +570,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_public_ip_addresses_operations_async.py index d6b9975f1bf1..230e36660f7f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_filter_rules_operations_async.py index feec7a9a78f5..339f89b2fb6c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_filters_operations_async.py index ef10d15e6db0..679d7bbba742 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_tables_operations_async.py index e02a8165490b..17713981a2fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_routes_operations_async.py index 98eb2eb5b91b..775f10e24939 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_security_rules_operations_async.py index 88ce88bad846..f5c8355fb21e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_subnets_operations_async.py index 60ec735f2d4f..8b20c08343ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_usages_operations_async.py index 953742c4b390..6569db4f5882 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_hubs_operations_async.py index 7069671c3065..10c6c500717e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 39304c54419e..d7eb2af30e37 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py index feceef256fd5..c060e7483165 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -697,8 +691,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -722,7 +716,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -751,7 +744,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -768,8 +761,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -818,8 +811,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -843,7 +836,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -889,8 +881,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -938,8 +930,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -961,7 +953,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -985,7 +976,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -999,8 +990,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1048,8 +1039,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1073,7 +1064,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1098,7 +1088,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1113,8 +1103,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1196,7 +1186,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1218,8 +1207,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1241,7 +1230,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1265,7 +1253,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1279,8 +1267,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1328,8 +1316,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1352,7 +1340,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1377,7 +1364,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1393,8 +1380,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1443,8 +1430,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1468,7 +1455,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1497,7 +1483,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1514,8 +1500,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1586,7 +1572,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1608,7 +1593,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1623,8 +1608,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1711,7 +1696,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 0577f63d4ead..96f71bc11106 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_networks_operations_async.py index 566ad64fe0af..9e9e8d2cc26b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -616,7 +611,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -656,6 +650,10 @@ def list_usage( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -669,15 +667,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_wans_operations_async.py index 6a0cf57a8c6e..a53d00e8fad4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_connections_operations_async.py index 0106129cabe0..211a02a80df0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_gateways_operations_async.py index 202e0c80800a..84c68fc065ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,6 +461,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -479,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -532,6 +526,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -543,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index b1313339136a..58d3cc9d08ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_sites_operations_async.py index 282994af7642..e6961e1623e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_04_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 6bbf40d4d635..0ac689f40891 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 db3b7510af1b..f55ee59b3f82 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 89c4dc04f323..fe31e566b024 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1ee8d6012835..0ea2e85a5bae 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8e90dbd1e4e9..6a4e308ab44d 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 be1a22055218..8f83ff433fac 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -94,7 +93,6 @@ 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('ConnectionMonitorResult', pipeline_response) @@ -115,7 +113,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -375,7 +371,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -396,7 +391,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -482,7 +477,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -503,7 +497,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -590,7 +584,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -599,7 +592,6 @@ def _query_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('ConnectionMonitorQueryResult', pipeline_response) @@ -619,7 +611,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -702,6 +694,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -715,15 +711,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 730b1607a088..a2fcfaec344d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 86f57837b8ec..59153e4a6bde 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 da6ac66c2673..5aa49ffa7c1b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d1741503f595..1d1050257379 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 @@ -78,7 +78,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -208,7 +207,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -261,7 +259,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -274,7 +271,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -296,7 +292,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 f486f4e760e5..325c7884ec5f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 302049d81895..902b5f5a12a4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 18ca882f9700..1f8744c70181 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 86d2ca51ab12..5afe50179f0b 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 a91a0002ee4f..b05a4c2027ba 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f6ca24d396d4..11085dbb5814 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 46fd232db662..a3641ba061f8 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 d7bf2e163460..48489aca48be 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 1fb9ba1f14dd..8fabd1e45ab4 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 aae9fe0c557e..30143ffc26dd 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 95d7aa6b0b30..2406d849ed75 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5dde565420ba..0ccfa71a9b8d 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 4d617f97990c..1da307b44709 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 86801892cdad..0b059fe6db8f 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 07ee7343c10f..5b16e9b879fe 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c092c6ef5b7a..8a8ae045c12f 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 634cb8288150..8b0cd09fd5ea 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 80b209583aaf..f2b985e70e04 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 885107f52d9c..92c7f809b85b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b1effc61bfd5..7a8d8b37aca3 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -105,7 +104,6 @@ def create_or_update( 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('NetworkWatcher', pipeline_response) @@ -158,7 +156,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -203,7 +200,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,7 +219,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -321,7 +317,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -363,6 +358,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +374,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -428,6 +423,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -439,15 +438,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -519,7 +514,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -572,7 +566,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -585,7 +578,6 @@ def _verify_ip_flow_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('VerificationIPFlowResult', pipeline_response) @@ -605,7 +597,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -696,7 +688,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -709,7 +700,6 @@ def _get_next_hop_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('NextHopResult', pipeline_response) @@ -729,7 +719,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -820,7 +810,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -833,7 +822,6 @@ def _get_vm_security_rules_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('SecurityGroupViewResult', pipeline_response) @@ -853,7 +841,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -944,7 +932,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -957,7 +944,6 @@ def _get_troubleshooting_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('TroubleshootingResult', pipeline_response) @@ -977,7 +963,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1068,7 +1054,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1081,7 +1066,6 @@ def _get_troubleshooting_result_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('TroubleshootingResult', pipeline_response) @@ -1101,7 +1085,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1192,7 +1176,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1205,7 +1188,6 @@ def _set_flow_log_configuration_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('FlowLogInformation', pipeline_response) @@ -1225,7 +1207,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1316,7 +1298,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1329,7 +1310,6 @@ def _get_flow_log_status_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('FlowLogInformation', pipeline_response) @@ -1349,7 +1329,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1441,7 +1421,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1454,7 +1433,6 @@ def _check_connectivity_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('ConnectivityInformation', pipeline_response) @@ -1474,7 +1452,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1566,7 +1544,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1579,7 +1556,6 @@ def _get_azure_reachability_report_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('AzureReachabilityReport', pipeline_response) @@ -1599,7 +1575,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1691,7 +1667,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1704,7 +1679,6 @@ def _list_available_providers_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('AvailableProvidersList', pipeline_response) @@ -1724,7 +1698,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 ba1cede7f1cc..e11f7b493497 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 38e22912d1d6..e3b685dd50e6 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -110,7 +109,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -216,7 +215,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -263,7 +261,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -284,7 +281,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -370,7 +367,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -391,7 +387,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -478,7 +474,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,7 +482,6 @@ def _get_status_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('PacketCaptureQueryStatusResult', pipeline_response) @@ -507,7 +501,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -590,6 +584,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f68acdde0daa..40f359ecc0f5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d1ae42bd84d3..2b69239b7ecd 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8a24d80a4675..63929ece69e5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3ed96cc41d73..469af647ed27 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dd0dbd1fefdb..15da9e3370da 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ec94b44ac574..9bd804da278c 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f22a09cd46ed..e3082a3346a8 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 54f9bcef9d61..1f5ea413a171 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a1c9029b3bf8..e3aa1fd260cc 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 56dd950b3a7e..68e1630d05c0 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 d2b1dac17b2c..8947b5d452d9 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -713,8 +707,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -738,7 +732,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -768,7 +761,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -836,8 +829,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -861,7 +854,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -891,7 +883,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -958,8 +950,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -981,7 +973,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +997,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1070,8 +1061,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1095,7 +1086,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1121,7 +1111,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1220,7 +1210,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1243,8 +1232,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1266,7 +1255,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1291,7 +1279,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1355,8 +1343,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1379,7 +1367,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1405,7 +1392,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1472,8 +1459,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-01" @@ -1497,7 +1484,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1527,7 +1513,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1617,7 +1603,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1640,7 +1625,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1744,7 +1729,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 7b1e3a8a31d6..efe89ff28163 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0e9d18439640..191fbf604671 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -630,7 +625,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -671,6 +665,10 @@ def list_usage( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -684,15 +682,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 633dbfe91999..716bc8afc5f6 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 359512bc9371..6380454bdc93 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 522d901c8bc6..2b4e762c1315 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -479,6 +473,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -491,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -545,6 +539,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -556,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 69cd556cf79c..4747a9208456 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 43b74f6dfa57..b814f5e16649 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5eecb26e9783..88b509c15752 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 @@ -97,11 +97,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -109,6 +107,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_application_gateways_operations_async.py index 2d31443325d9..03506860258d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_application_security_groups_operations_async.py index 3f5402ea1582..8480ec374441 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_available_endpoint_services_operations_async.py index ec38f7158fde..40cf8fc687b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_azure_firewalls_operations_async.py index e908e3f5ae10..38ca18267a48 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_bgp_service_communities_operations_async.py index 9e30dff06914..224ab2c65f2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_connection_monitors_operations_async.py index 67154a64d2fc..0064ab198bfb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -368,7 +364,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +384,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -404,8 +399,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -474,7 +469,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -510,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -581,7 +575,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -591,7 +584,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -610,7 +602,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -625,8 +617,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -692,6 +684,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -705,15 +701,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py index 7072974a73cf..4eb78c61e1b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_default_security_rules_operations_async.py index a5ffbd88b83b..eb6dc6022582 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 8e5f9489b196..22c077593cf7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index 74fe592e43f8..2685869d416f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -73,7 +73,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -112,8 +111,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -201,7 +200,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -253,7 +251,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -266,7 +263,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -287,7 +283,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -307,8 +303,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 80b521426771..b06556a3b5e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuits_operations_async.py index 5cc3537dd1a9..a4e7521b58fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index c387d9f89c77..d138f5eaf8b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 1a6ccd00b2db..f0279a308c35 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_service_providers_operations_async.py index 10056a4e7a44..c42a58d5350d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index a369daae645d..521e1af84bac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py index b63328e1388b..c23212015dd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 88aa14b29e95..29607a8c4baf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 39fa0a6c0b62..9d67434349ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 0788d29758cb..2a6b598202b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 34fcc0cda22d..25f238a7279a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_probes_operations_async.py index 7f070cb9ac2c..631732d3012d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancers_operations_async.py index 179b745c2fe2..a96bf17cc512 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_local_network_gateways_operations_async.py index d9c7ec042432..edb38005a8be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index f07aaebecf2f..a2ca3cba943d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index c303e8939e70..fb6b6c746ad2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interfaces_operations_async.py index 6bb521fe0888..2614d96fe2f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_management_client_operations_async.py index 94ceed8cc3a1..f0acea066345 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_security_groups_operations_async.py index 00b2ab59bce4..14aca0e7281c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_watchers_operations_async.py index d9444ff1eb3b..6182dea1eeed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": + ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1847,8 +1819,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_operations_async.py index 7ef0069cc4a1..921e5f89910c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_packet_captures_operations_async.py index d995b7e46fc8..a42ec2620d75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_public_ip_addresses_operations_async.py index 4565bcbe73d2..874cafd4e5cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_filter_rules_operations_async.py index e60a3de2e71a..ba76e765281e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_filters_operations_async.py index f5b737c07859..6e67aab694d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_tables_operations_async.py index 08d9a4a0d302..7992c7cd9fc9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_routes_operations_async.py index 2cb76b7ca6d0..432358ddd12d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_security_rules_operations_async.py index a30b4e937858..094f1eec2462 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_subnets_operations_async.py index 8639293308cd..1ee09ead4c99 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_usages_operations_async.py index fca102048110..8fe1a6440b07 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_hubs_operations_async.py index b7b3fcbddc5c..1bee7283aba6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 6665f1b80415..4b07057e6705 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 9213f74477fc..0c6b00bebd19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -718,7 +712,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -737,7 +730,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -751,8 +744,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,8 +790,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -822,7 +815,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -851,7 +843,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -868,8 +860,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -918,8 +910,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -943,7 +935,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -972,7 +963,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -989,8 +980,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1038,8 +1029,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1061,7 +1052,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1085,7 +1075,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1099,8 +1089,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1148,8 +1138,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1173,7 +1163,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1198,7 +1187,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1213,8 +1202,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1296,7 +1285,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1318,8 +1306,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1341,7 +1329,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1365,7 +1352,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1379,8 +1366,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,8 +1415,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1452,7 +1439,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1477,7 +1463,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1493,8 +1479,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1543,8 +1529,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1568,7 +1554,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1597,7 +1582,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1614,8 +1599,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1686,7 +1671,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1708,7 +1692,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1723,8 +1707,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1811,7 +1795,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py index d58786390911..b0648add83bc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_networks_operations_async.py index 64164c528f74..e5dcbbd57efa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -616,7 +611,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -656,6 +650,10 @@ def list_usage( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -669,15 +667,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_wans_operations_async.py index 3dd0a5b1693b..63c8f0283688 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_connections_operations_async.py index 9a4fed6ab9a1..8300f93964e3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_gateways_operations_async.py index 6c87005c4d12..06dccf8b3871 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,6 +461,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -479,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -532,6 +526,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -543,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 6014a734a5f0..592535f53ef9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_sites_operations_async.py index caff5d9d28f8..a014cc8d392e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_06_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_06_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 678c00fbbab2..95626e386b13 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d7c400153393..b984d8d24b9d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7ed8e85acb02..e383565fbeb5 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dfe15276f5d9..c7e88f381015 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c8d345a6153e..192318f7ba29 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 653bb3648301..3d3549736b00 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -378,7 +374,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +395,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -486,7 +481,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -595,7 +589,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -605,7 +598,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -625,7 +617,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -708,6 +700,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -721,15 +717,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 930501aa5eb0..d5f2757bae65 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b4b802d65ec3..dc8a0d840b8c 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3789bcc03686..c12f6de2eb8a 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8ce61c6121a4..42892ab6baa9 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 @@ -78,7 +78,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -208,7 +207,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -261,7 +259,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -274,7 +271,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -296,7 +292,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 64b425fc9e9d..39b0dbd66cc5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9d09abd1875f..a94c79b14355 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9f9d070998e5..3b531e17b14e 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 d67f5ffb2caf..05704ce068a7 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 66270fcfcda6..49a0a2781d14 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7788421995f2..c7751cf59667 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 54450eea437d..1f76e56a8515 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 0aef95315410..bf16cd48a5a0 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d1f492dccdd2..5f5a9ea1f97a 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 0e78a3f4ba9d..d13d9c21e6ea 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 719313d3c50c..081af6ec265f 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6b36da7d99cb..8549891aa256 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 088eb3fed043..e67ffedf0168 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 945edbdeb520..5e9de4420437 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 80762e37946b..20c9078245cd 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 46fba07ec7da..396a2ea5b1b2 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 87fa2835e366..16a8bd5ec4e9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 679c8736e2af..4bdef92cbdf6 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a63cc789a337..4e172fc7ece4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2e06cd0a9ec2..e117df822ec2 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. 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 fcd6e6a88b81..72e0d96e7361 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 955c061501c4..af08be03f2da 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 31bca9f31177..b57a488a1d2e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 1af2de004438..566e3af8a5cb 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5120d224d668..ac3f344279b7 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a848674e79ff..2c123674fa02 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 827a991a7d67..108f3813996c 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5456409955c9..bd97d367a3f7 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 93f392a1e2e6..7c83fdc72413 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ab6b957a29b4..403674b6aa78 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5c94c38484ac..cb012aa86d54 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 020d6a9e5a19..e9f1ccb7108c 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 b066a0bf23db..5f8301056166 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -734,7 +728,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +747,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -815,8 +808,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -840,7 +833,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -870,7 +862,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -938,8 +930,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -963,7 +955,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -993,7 +984,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,8 +1051,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1083,7 +1074,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1108,7 +1098,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1172,8 +1162,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1197,7 +1187,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1223,7 +1212,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1322,7 +1311,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1345,8 +1333,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1368,7 +1356,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1393,7 +1380,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1457,8 +1444,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1481,7 +1468,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1507,7 +1493,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1574,8 +1560,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01" @@ -1599,7 +1585,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1629,7 +1614,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1719,7 +1704,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1742,7 +1726,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1846,7 +1830,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 11218b8cbdca..902486bcbb82 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6f7d0e423a1b..b8be3490bc66 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -630,7 +625,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -671,6 +665,10 @@ def list_usage( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -684,15 +682,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 338257660052..b60721da2155 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0d75779ae1f5..5c1400170d72 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 da20ba26e3bd..1bc1f4f76dcf 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -479,6 +473,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -491,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -545,6 +539,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -556,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 71a170facc75..6360d6d208a3 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 d1cba873083c..dca989110c58 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ccec79624e2c..527798903967 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 @@ -100,11 +100,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -112,6 +110,6 @@ "call": "location, domain_name_label" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_application_gateways_operations_async.py index 539cb78a306f..ecd8ba6045e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_application_security_groups_operations_async.py index d0b9d9abcb11..c88bbaa3b903 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_available_endpoint_services_operations_async.py index 1bc090bac151..a519c24b10e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_azure_firewalls_operations_async.py index 7f93d053222b..dc806186ff44 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_bgp_service_communities_operations_async.py index 7786041f3343..f903c005f209 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_connection_monitors_operations_async.py index 617010aaa2f1..3b60fa1e5472 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -368,7 +364,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +384,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -404,8 +399,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -474,7 +469,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -510,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -581,7 +575,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -591,7 +584,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -610,7 +602,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -625,8 +617,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -692,6 +684,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -705,15 +701,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_ddos_protection_plans_operations_async.py index e253d898cd14..4bbd239b3f9f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_default_security_rules_operations_async.py index 40aa136a2e92..2843b3fbcf7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 102263d68df1..230a57353aba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index a74b034ee07c..e1d31c25e5ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -73,7 +73,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -112,8 +111,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -201,7 +200,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -253,7 +251,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -266,7 +263,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -287,7 +283,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -307,8 +303,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 400ce8ef740a..fab1e9962154 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuits_operations_async.py index b6552a9ab291..d5b17a33e4d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index fc0b5bb10d7c..d958c48e3cc9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 8bcdcddf1ecd..2d906dd1ee7d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_service_providers_operations_async.py index 28d1ac9614b0..ea831790190e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index f8e8d9cc1791..0fd7bc7443eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 80b574c49b21..ee75b745330d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index f769962e7919..e61b1c089862 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index fc5ab574c9f1..ed2de14d6c00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 234a9a58f88c..1558ff5730fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 4f92d207d60d..a4a026c01315 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_probes_operations_async.py index 5a7e36a1ce77..a0c255daef6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancers_operations_async.py index 208375157daa..c82def747fe8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_local_network_gateways_operations_async.py index 889acc9f9b41..4038c7d41b4d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index f2cb83ac115d..8927489e0143 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index 96f16aa0bdae..8d101580092e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interfaces_operations_async.py index 61a51238a032..7b5620eecb4a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_management_client_operations_async.py index 7bcc192816be..57d0ee5d17e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_security_groups_operations_async.py index 6290206863fc..c7cd1888a495 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_watchers_operations_async.py index 2cdf04afa060..032d8d809d29 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": + ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1847,8 +1819,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_operations_async.py index e5bccf6f807d..ca6307ce3a27 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_packet_captures_operations_async.py index 6f0e1ca82e64..47b543211659 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_public_ip_addresses_operations_async.py index 61b25ccacc03..40cdece2bf2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_public_ip_prefixes_operations_async.py index 5137fc5e9d71..a62ef000e5f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_filter_rules_operations_async.py index 55cbbffb3d45..34ec27529dba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_filters_operations_async.py index 7f866d119d25..a39decd4e3a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_tables_operations_async.py index ba6a8e413133..6cf9f40b2be2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_routes_operations_async.py index 420b653c6e58..a9ed0e142ab8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_security_rules_operations_async.py index 271b031c703e..fdafc7f878eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_service_endpoint_policies_operations_async.py index 006ce5513a94..1b66e4df47b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index 31bd67b27b5a..88ee13395385 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_subnets_operations_async.py index 25edb8b24fc5..ba74aa67bbb2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_usages_operations_async.py index d8dd643e5815..2697c8fac447 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_hubs_operations_async.py index 1e5ffbd03f3f..dff2adfc6779 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 1235f01453a2..ca69f1cc6291 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 3deb47fdab41..58b6e86a9585 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -697,8 +691,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -722,7 +716,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -751,7 +744,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -768,8 +761,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -818,8 +811,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -843,7 +836,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -889,8 +881,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -938,8 +930,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -961,7 +953,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -985,7 +976,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -999,8 +990,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1048,8 +1039,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -1073,7 +1064,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1098,7 +1088,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1113,8 +1103,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1196,7 +1186,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1218,8 +1207,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -1241,7 +1230,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1265,7 +1253,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1279,8 +1267,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1328,8 +1316,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -1352,7 +1340,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1377,7 +1364,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1393,8 +1380,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1443,8 +1430,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -1468,7 +1455,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1497,7 +1483,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1514,8 +1500,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1586,7 +1572,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1608,7 +1593,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1623,8 +1608,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1711,7 +1696,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 73e4cd938d0f..401e060b7483 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_networks_operations_async.py index e8c695e5a57c..9a820ef1a3fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -616,7 +611,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -656,6 +650,10 @@ def list_usage( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -669,15 +667,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_wans_operations_async.py index c9b9be1283a5..2e38101d424a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_connections_operations_async.py index f9c8ef47bb9a..d06c82c6a053 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_gateways_operations_async.py index 1c9ffb9e7a7d..cb73a575e910 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,6 +461,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -479,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -532,6 +526,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -543,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 307fdadf5306..dee35f82bdc6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_sites_operations_async.py index 44a81f4aeadc..5daef01c2d4a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_07_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_07_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 346379365886..0e9e92a8d2ea 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 02804b54c62e..6e7f700a2de7 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 69523d765832..1b80e975afa3 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7c8942c649e4..7359fb614036 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 92cef3953895..489f9d715714 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8214ff5fdd88..3152b5010430 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -378,7 +374,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +395,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -486,7 +481,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -595,7 +589,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -605,7 +598,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -625,7 +617,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -708,6 +700,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -721,15 +717,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 73b8dcd0de90..5fd6a3afa9e7 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e96833432719..46c179788128 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8ae50a15fb60..0489e02ea2e9 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8825bb886d0b..489436cd2a81 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 @@ -78,7 +78,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -208,7 +207,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -261,7 +259,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -274,7 +271,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -296,7 +292,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 c8a78e14794f..cd4e7f61a91d 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e4cbb5de5a5f..23d7bc3cd855 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 75970ac825fa..7e505e5405ce 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 8c5cd6a2e765..9eb17b1ce89c 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 195660356b03..9a40deb5bc18 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f6e1a5fdec01..8898721000b1 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 921d9baa6244..06b69bf19474 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 f67bf3b3071e..3340c5bace3c 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d0d683aca995..d317846864d8 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8f03ec0ff5ab..49bb91242bb4 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 90bb6764beb4..cc396d5dba62 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bfad6e9dc3f4..096282206370 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 29ae77aa11b4..b4e2dd6a6d88 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a4f191fe7a85..fbc673d4d5d8 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0e1d9ee8f14f..91344018074f 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 7db8b486d42f..c00acc6617a3 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7790d207301b..09892ff01990 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 9582cf4b3373..2e39f9470ab8 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8abc3ee6852b..556ed8f261a4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c20c00d2f767..7dcfc2008850 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. 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 a04edd4ddd51..126eca8ab06c 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d14064b3cfe0..aa134428f1fb 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f2821858e951..247be593565e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5d5133282235..e0e993c5de92 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8a72350aa095..7f9b409db411 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1e301aa98293..38e077811654 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 492620b6b74e..1629a22c903b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 21edf8e46f1c..c6b4bd93aa90 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fa6593d5c00d..5c5881fd76ff 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 738a7e6b1d13..7e27fe32fea6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b8d573d69d40..fcd3b40b2620 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2f9f20f1a53c..a63556b74830 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d6a3cfa536b6..63947b79571b 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 04595637b639..64da456a34df 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 004e63a8b022..ad79bf64a398 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 f90a105d35e0..f984e8e5faae 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -713,8 +707,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -738,7 +732,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -768,7 +761,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -836,8 +829,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -861,7 +854,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -891,7 +883,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -958,8 +950,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -981,7 +973,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1006,7 +997,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1070,8 +1061,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -1095,7 +1086,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1121,7 +1111,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1220,7 +1210,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1243,8 +1232,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -1266,7 +1255,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1291,7 +1279,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1355,8 +1343,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -1379,7 +1367,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1405,7 +1392,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1472,8 +1459,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-07-01" @@ -1497,7 +1484,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1527,7 +1513,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1617,7 +1603,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1640,7 +1625,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1744,7 +1729,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 9b5ebc0a1bb1..30d961a25d97 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0a9e38e1a180..6f5eb7716e9e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -630,7 +625,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -671,6 +665,10 @@ def list_usage( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -684,15 +682,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8c71b55c4e2e..7d25d3bb0f47 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e59eae7967c5..8641339fb88b 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aed379f8efe6..804093bf4343 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -479,6 +473,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -491,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -545,6 +539,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -556,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 37a8d98f3ee3..0206cbdc61da 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 197d7b059bc8..adf19f7d932a 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b2d5acfba1b1..553746c7c702 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 @@ -115,11 +115,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -128,11 +126,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -140,6 +136,6 @@ "call": "resource_group_name, virtual_wan_name" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_application_gateways_operations_async.py index 7558ff352090..de652352a0c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_application_security_groups_operations_async.py index bad3b35f54de..c3bdbbae808e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_delegations_operations_async.py index 567ae5c78749..3bec07c1b6a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_endpoint_services_operations_async.py index cd1391283e01..423052180835 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 96c767e38c72..464746940bbc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 704637b96859..068bb1f6d1b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_azure_firewalls_operations_async.py index 0afefd984fa5..10202627f96c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_bgp_service_communities_operations_async.py index 72754b4d2341..0df18e90a9ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_connection_monitors_operations_async.py index 1fab859d0f72..06695a820e4e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -368,7 +364,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +384,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -404,8 +399,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -474,7 +469,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -510,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -581,7 +575,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -591,7 +584,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -610,7 +602,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -625,8 +617,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -692,6 +684,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -705,15 +701,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_ddos_protection_plans_operations_async.py index c7ae0ec67ca8..a0bc3fd9c6e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_default_security_rules_operations_async.py index 7c7621cf8ab9..199beae53cf1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index a9b705bcc1d3..021ae1441025 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index 55323e4f8fe8..d9f5de3a792c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -73,7 +73,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -112,8 +111,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -201,7 +200,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -253,7 +251,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -266,7 +263,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -287,7 +283,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -307,8 +303,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 1e8a2d0ef56e..c1dbe082af25 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuits_operations_async.py index e60fee5ba5d5..19b4310f539e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_connections_operations_async.py index 380b4f823e77..765bbcbf25b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index f396eda262e6..47ae85ccc009 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_cross_connections_operations_async.py index fced0080affe..1ef77872e6e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_gateways_operations_async.py index ff319c4fb3a4..a070cd4a7da7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_links_operations_async.py index 014276d38034..6c340db0f037 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_ports_locations_operations_async.py index fe785f3476a9..0334caaea273 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_ports_operations_async.py index 857502553955..29bd02ac4d50 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( express_route_port_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_service_providers_operations_async.py index cb9d80d06404..8c2419c49c90 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 66d4cbe2bd2a..d8994723d2ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py index cfcdf4645337..8dc991f7d28e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_interface_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_interface_endpoints_operations_async.py index 41738ff23bc4..167cb7d50a77 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_interface_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_interface_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, interface_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( interface_endpoint_name: str, parameters: "models.InterfaceEndpoint", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: InterfaceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.InterfaceEndpoint + :return: An instance of AsyncLROPoller that returns either InterfaceEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.InterfaceEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_by_subscription( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index ad2102c4a9be..9cc565d4254d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index f3c7808747ee..49df59306ef1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 95c2832c0d24..a8e9b9f5ada1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index f40fdec33714..439585752013 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index aa3bedc21906..6e9cde04584c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_probes_operations_async.py index 7459fab0e28b..99fdfd17ed69 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancers_operations_async.py index 5ab9a8f8abfe..27897af11af5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_local_network_gateways_operations_async.py index 79a9ddcaddff..9c5cccd50219 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 30b0f88e6c31..050cfbee1300 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index d6d9d2e71103..6ec807e7e3f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 840a69836cde..fc83fe3f8ceb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interfaces_operations_async.py index abcb3fbd6baa..2643aeef34b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_management_client_operations_async.py index 625f416819a9..42020e2f0ca7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -117,7 +116,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_profiles_operations_async.py index 53cd7931f871..6d26e04c94c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_security_groups_operations_async.py index 7bd1fae30e2b..fec72b3c05a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_watchers_operations_async.py index 943b07f022f4..5040e4aeda21 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": + ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1847,8 +1819,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_operations_async.py index 9d21860185d5..2dc4affaf2ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index 54c0c583d3b0..25a4663b5ffd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, p2_s_vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -304,8 +299,8 @@ async def begin_update_tags( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,7 +370,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,7 +389,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -408,8 +402,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -468,6 +462,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +478,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -533,6 +527,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -544,15 +542,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,8 +580,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -611,7 +605,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -640,7 +633,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -656,8 +649,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py index 4f6a9eca9202..3d2e9345d5c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( p2_s_vpn_server_configuration_name: str, p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: P2SVpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.P2SVpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either P2SVpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.P2SVpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list_by_virtual_wan( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_packet_captures_operations_async.py index 61ef96fde0af..3094b301a2ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_public_ip_addresses_operations_async.py index bbb06f34042c..abc633500f35 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_public_ip_prefixes_operations_async.py index 1c9e0c0e98b2..7e2f2b9d0de0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_filter_rules_operations_async.py index 2e1d3bf54be4..b2ba9e3bb973 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_filters_operations_async.py index c18286059c56..32e78c6b9752 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_tables_operations_async.py index 64da12baba38..0476e2f28c26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_routes_operations_async.py index df9b4c6d3707..a996b98ee1b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_security_rules_operations_async.py index b72ad7ff5889..de827afef7c8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_service_endpoint_policies_operations_async.py index bba5121ff604..5ededd1e6fa2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index b0b4fcd28cb3..590fe29fee87 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_subnets_operations_async.py index 3fbe52f68fb2..0cb7954d4a29 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_usages_operations_async.py index c65f2d1f4581..f88cddba4ba9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_hubs_operations_async.py index 621714286f84..241566813e43 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index e169d1ba492e..1bf334e807c0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 477f9647dc58..4636480099b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -718,7 +712,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -737,7 +730,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -751,8 +744,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,8 +790,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -822,7 +815,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -851,7 +843,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -868,8 +860,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -918,8 +910,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -943,7 +935,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -972,7 +963,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -989,8 +980,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1038,8 +1029,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1061,7 +1052,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1085,7 +1075,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1099,8 +1089,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1148,8 +1138,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1173,7 +1163,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1198,7 +1187,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1213,8 +1202,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1296,7 +1285,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1318,8 +1306,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1341,7 +1329,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1365,7 +1352,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1379,8 +1366,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,8 +1415,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1452,7 +1439,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1477,7 +1463,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1493,8 +1479,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1543,8 +1529,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1568,7 +1554,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1597,7 +1582,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1614,8 +1599,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1686,7 +1671,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1708,7 +1692,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1723,8 +1707,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1811,7 +1795,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 70a34eeb6f19..f7ff33f56874 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_taps_operations_async.py index 45d158def169..045b4e57f660 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( tap_name: str, tap_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_networks_operations_async.py index 00bc8b512090..043deb5b2fa3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -615,7 +610,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -655,6 +649,10 @@ def list_usage( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -668,15 +666,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_wans_operations_async.py index ae6cd7de4df7..10f54fb06f96 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_connections_operations_async.py index 203954643f00..bc9edb76fe0a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_gateways_operations_async.py index 4c84f1e5b597..c3ad8fa944ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,6 +461,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -479,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -532,6 +526,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -543,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 48e9a81a0533..09f0bf26fc8d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_sites_operations_async.py index bd08996c54c2..604a2964ef86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_08_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_08_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 a8272e501d00..892a12bd0330 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 b276eef6d22e..5460e0bc18a6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b17e49830d02..ae4705c174b4 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ea5aae1a2dd8..0e46bf868259 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2fc6099d8bee..c044baae6703 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 711b5ecaacb3..1df8f817c371 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e2c21b361eaa..dc0443ee12ab 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 da66827f46e0..b7c2090bc951 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 680431749f51..3b7baac0ddac 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -378,7 +374,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +395,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -486,7 +481,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -595,7 +589,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -605,7 +598,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -625,7 +617,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -708,6 +700,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -721,15 +717,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c9be74490196..099258104e36 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4d95046d6124..35765c1182cc 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 2d7c38321140..0a56467ebb1f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7b194f96b0d6..b06f4f0e86af 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 @@ -78,7 +78,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -208,7 +207,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -261,7 +259,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -274,7 +271,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -296,7 +292,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 d734e48c36f6..ecc1184859cc 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5ebf16572a74..7bebd5bf76b5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2536be7d80b2..59d3ea7f9487 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3edcfd1d75b3..ffc7e1833d19 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 77cde6b47411..d40c63217b5d 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 3714786b6c39..c5ab52c66e06 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 d8ddfdeb3bcf..4a6e2fc3a965 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 177d2c5276c6..034b8a0da7ca 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 972083aeebe1..44d9052033fa 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fa96df7a9b71..c5297033d86c 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b07aaf6bce4e..7373f282e8b6 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2620a93eb211..b7cea3b09f67 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 abae80c4ac8c..6b7f24e377a2 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( interface_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_by_subscription( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a8652a2054b5..0c8a0e28f114 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 23d5b8f61adc..8143d35162ad 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 06f40f98706e..93d27f5efff1 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 afc270cc80df..3ffcf1f035e0 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e695518a55d5..55046fb585d3 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 254a29110f3c..c4132512438d 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 28bfa539b42c..c33912bd3e22 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f64f1a56e71c..4ce84b3ee615 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 328ab3d5e236..41854c865884 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 06e26fb24b91..5f828cdbb8e5 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2c035dad6460..5cf372157b87 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 52fc7a2202a9..d18d3a26a65e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 08fbe75b7f54..6095fc204d91 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -123,7 +122,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 59019bd605ff..75de9dd1ef5c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 976445366709..0e4475d5ef02 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e7aaa0fdab9f..a9d169e5aa7b 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. 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 3fa3f1951345..ab98e6513dff 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1c2045137899..a5c232c6cfda 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( p2_s_vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -385,7 +380,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,7 +400,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -480,6 +474,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -546,6 +540,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -557,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,8 +594,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -625,7 +619,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -655,7 +648,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 8550c191c249..fc86b199aa21 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -374,6 +370,10 @@ def list_by_virtual_wan( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 95ce968860cf..7e084715a377 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fdf9db599618..9742c0b4c893 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ec3e391c58ef..d222bf6a7bd9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e1df7aa09aab..91b091f13c42 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4187377ccca5..b7f20399e1fe 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9639756f257f..83563ffb2768 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a72be8a98175..fc17312a88e2 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 640845b29f56..9529b09f9593 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1b806ba05dba..79c2aa13ec4c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1c1de4764e96..1cf6b85acb91 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a64fb0912c79..63d3781fc7ca 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 01df81f7d8f5..7e48c7ac61a8 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 46959cb05f61..e2828d34259f 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8af97204f6ac..1f2010782501 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 8639e7b43a12..240d49b56e52 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -734,7 +728,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +747,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -815,8 +808,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -840,7 +833,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -870,7 +862,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -938,8 +930,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -963,7 +955,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -993,7 +984,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,8 +1051,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1083,7 +1074,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1108,7 +1098,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1172,8 +1162,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1197,7 +1187,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1223,7 +1212,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1322,7 +1311,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1345,8 +1333,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1368,7 +1356,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1393,7 +1380,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1457,8 +1444,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1481,7 +1468,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1507,7 +1493,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1574,8 +1560,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-08-01" @@ -1599,7 +1585,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1629,7 +1614,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1719,7 +1704,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1742,7 +1726,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1846,7 +1830,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 4e16ea8a5f75..87ee0f3af39b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9b5497fcb303..d39da095d908 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( tap_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 29d40eb803e7..2dc33eaa5194 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -629,7 +624,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -670,6 +664,10 @@ def list_usage( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -683,15 +681,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1826bad4c13d..7d4c53f09778 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f212ca6dbd76..0d525cd5865f 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0e9e16bafbc8..fd0bdba097b7 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -479,6 +473,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -491,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -545,6 +539,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -556,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 68348e21c4e4..0b337a291aec 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 6075c077f1bc..da42ad4f3cfe 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ad5707823db6..5dea4a204eff 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 @@ -115,11 +115,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -128,11 +126,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -140,6 +136,6 @@ "call": "resource_group_name, virtual_wan_name" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_application_gateways_operations_async.py index 4f5fed46ff96..8852d450df15 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -959,7 +950,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -993,6 +983,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1004,15 +998,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1074,7 +1064,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_application_security_groups_operations_async.py index d84a7c6077af..8d2f5b28a8e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -338,6 +334,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -349,15 +349,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -416,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_delegations_operations_async.py index c2a28dffd878..89432c24aa95 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_endpoint_services_operations_async.py index 3018bd8df69d..445772c33374 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 49a66063168e..b2b56e8e104b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 1eb19295506b..9a0527c88152 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_azure_firewalls_operations_async.py index 2d0c6078583f..eb3b7c491c45 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_bgp_service_communities_operations_async.py index eeed79d116dc..2b25b671dbe6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_connection_monitors_operations_async.py index 0ec39909b19e..1bf630aa5359 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -368,7 +364,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +384,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -404,8 +399,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -474,7 +469,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -510,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -581,7 +575,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -591,7 +584,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -610,7 +602,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -625,8 +617,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -692,6 +684,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -705,15 +701,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_ddos_protection_plans_operations_async.py index 824314e6274a..4148f1ade116 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_default_security_rules_operations_async.py index 814459b7c0ba..740c1b883a8b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 07f49f8c7d83..41f6bfc95eb9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index 87dd907e4207..1f42118d529e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 85c149f07e2a..2acb1be9c66d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuits_operations_async.py index d8fe29e36c11..2ded0afc11aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_connections_operations_async.py index d88f338c0089..0d7607a2ee75 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index aa165f9ac2e6..79149d654398 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 39578e59c780..3f3753d0faaf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_gateways_operations_async.py index 87750045c04d..18359e659e4e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_links_operations_async.py index 7b0d42310eb4..32f7c5519e2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_ports_locations_operations_async.py index c72709516b20..e7f9d6e2cb85 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_ports_operations_async.py index 195e5538bd6c..289b2955a3ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( express_route_port_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_service_providers_operations_async.py index 5e3971bee268..ad71f8ab408c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 8a2f46ad0863..a89174641bf0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 524d57aa0eaa..a6a7eb12666a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_interface_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_interface_endpoints_operations_async.py index 7d1d95139803..a9e77e4bdd7c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_interface_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_interface_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, interface_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( interface_endpoint_name: str, parameters: "models.InterfaceEndpoint", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: InterfaceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.InterfaceEndpoint + :return: An instance of AsyncLROPoller that returns either InterfaceEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.InterfaceEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_by_subscription( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index d37a435f59b3..f41f2320cc13 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 323dbbbb8bc7..337d762279a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index bd878135372d..d2d43b785791 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index a6237501e748..39d8bdced52e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index d4b83902b5fc..4d1f6c523a36 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_probes_operations_async.py index 711dfbc10332..55a06eb62d7c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancers_operations_async.py index b722c8681939..a134ce359faf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_local_network_gateways_operations_async.py index 16c9564ceae4..772e6c54a95b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index d55327457fcd..0b960eee8aa1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index 9f8a955018ec..029c9edbc820 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 284f604b0919..56dccec33f48 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interfaces_operations_async.py index 8f88b89fd643..cbc4246278bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_management_client_operations_async.py index 627f852e9419..a7c92f958f8f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -117,7 +116,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_profiles_operations_async.py index 3c8fb8b8a58a..3db9cb03ece6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_security_groups_operations_async.py index b913b8a27346..6b41b16b0001 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_watchers_operations_async.py index b4f9a77fbecf..911cb5c8aabe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": + ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1847,8 +1819,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_operations_async.py index d3db633136d4..142835470054 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index a0e7d4975b31..7889916ac262 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, p2_s_vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -304,8 +299,8 @@ async def begin_update_tags( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,7 +370,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,7 +389,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -408,8 +402,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -468,6 +462,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +478,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -533,6 +527,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -544,15 +542,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,8 +580,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -611,7 +605,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -640,7 +633,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -656,8 +649,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py index 146ca1ba35be..3928778f7c78 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( p2_s_vpn_server_configuration_name: str, p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: P2SVpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.P2SVpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either P2SVpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.P2SVpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list_by_virtual_wan( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_packet_captures_operations_async.py index 120f6ce67883..a5aafdc6499e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_public_ip_addresses_operations_async.py index a77ee42a5255..3685dac90b26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_public_ip_prefixes_operations_async.py index aec272c8ad03..d12d8f1863f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_filter_rules_operations_async.py index 3fde8612d0b4..6dc42a53f4c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_filters_operations_async.py index df49ba213206..aaa929cca5a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_tables_operations_async.py index d0d232ccde1d..7de2f7e55add 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_routes_operations_async.py index 2ebe94a4c14c..dda038796c44 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_security_rules_operations_async.py index 3b7397908edb..fa416829471e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_service_endpoint_policies_operations_async.py index 3d587baadb59..c1a7a2bd22a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index 0b248dd9fbaf..30e7a3697df8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_subnets_operations_async.py index ee5f6fa4e477..fe33464ca4b2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_usages_operations_async.py index c8c2f1b1087d..f26bbd3a7c9f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_hubs_operations_async.py index 93e4a86664be..064085931d39 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 614dd81e98e2..afc0ad9639db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 6fd7bdf3c0e0..b94469b6a1c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -718,7 +712,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -737,7 +730,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -751,8 +744,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,8 +790,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -822,7 +815,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -851,7 +843,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -868,8 +860,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -918,8 +910,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -943,7 +935,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -972,7 +963,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -989,8 +980,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1038,8 +1029,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1061,7 +1052,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1085,7 +1075,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1099,8 +1089,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1148,8 +1138,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1173,7 +1163,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1198,7 +1187,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1213,8 +1202,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1296,7 +1285,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1318,8 +1306,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1341,7 +1329,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1365,7 +1352,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1379,8 +1366,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,8 +1415,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1452,7 +1439,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1477,7 +1463,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1493,8 +1479,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1543,8 +1529,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1568,7 +1554,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1597,7 +1582,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1614,8 +1599,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1686,7 +1671,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1708,7 +1692,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1723,8 +1707,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1811,7 +1795,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 551804ae00f3..cb1374470989 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_taps_operations_async.py index e2f1b06f33f9..fd5a7e73e7ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( tap_name: str, tap_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_networks_operations_async.py index 4a9f7007156f..81c59ef1a0f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -615,7 +610,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -655,6 +649,10 @@ def list_usage( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -668,15 +666,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_wans_operations_async.py index ffc266091996..823f60f5d0fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_connections_operations_async.py index 2dbc10eea60e..b4b9674cf5b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_gateways_operations_async.py index 596c193866f4..7c98aeadcb2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,6 +461,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -479,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -532,6 +526,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -543,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index e413643db6de..e4b41445bed1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_sites_operations_async.py index 4660aa251fa1..3d965e21e802 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_10_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_10_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 5d8ab2f0cdc6..98aa1f584ce6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -980,7 +971,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1015,6 +1005,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1026,15 +1020,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1097,7 +1087,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5601cab9a7e1..3c1e074af64f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -348,6 +344,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -359,15 +359,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -427,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b1e68310873b..919c651e55a4 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0af12ffff92a..d76277f91613 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 40bc0e901c0a..173ad393c260 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 14b2fd0e4218..e3481cec4195 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fbe9aff1b600..cdb5dc882073 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d5086e0c6179..61a60356fe1d 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 64107a71d30d..5d2078b2eeb0 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -378,7 +374,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +395,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -486,7 +481,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -595,7 +589,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -605,7 +598,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -625,7 +617,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -708,6 +700,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -721,15 +717,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 71a013918a27..19257a4bd5ee 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4d71e4b5e59f..2e4775d689f3 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5a82231b910a..f1e1f207cc8a 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 79b800f0b53e..9a71275cc984 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5568373ca940..918305bfb5c1 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d9fb177757a5..7d95d9cffcd4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 eab3a1487714..f0883ead533e 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 2d8a23dd27fc..8fe9e54f0e33 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 7f1e86d9c807..07b9c2ed067e 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 7f3d85c1c22d..17d2f463dd8c 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 7949c96c2527..f55badbb470a 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e0a033aabbf7..a14c6bfda6fc 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8f1ae13cdd2f..e6d23153ce95 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a78a56cd832f..c2dbfb3c8568 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 da38da257fc1..a23070202028 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 75350e469404..c0ad27ee8fb8 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 f9de76398777..1ba988db92b6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( interface_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_by_subscription( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 02b556fa86b4..ccb616f3bfd8 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 2cc726749903..e875b059576a 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3d59a5683de0..0ae201f5c31d 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 41c40a46ab91..859403f16896 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f40de0a06e4b..07f392c0d8bb 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 42d3d8625b74..a261d9a00085 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ea22c1a14226..c1d045bd5dbb 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 09c31537209a..fa0d6e723a25 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 925bedbbd74a..6766c09eb988 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5f4da63a313f..41989c57023a 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5656a610a037..9d817c8986ad 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8182c4fc6ac1..3bb45406378a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 f810fa1c73a5..b0f768790035 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -123,7 +122,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 871efc6bb5c4..b553c00e1722 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8d8ff1f0771b..3b76bd4950fa 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 03a3bca64b3c..67b2747bc7d0 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. 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 445552bea6be..7bee5a635a99 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 95517ccd90cd..b7aefea475e7 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( p2_s_vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -385,7 +380,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,7 +400,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -480,6 +474,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -546,6 +540,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -557,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,8 +594,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -625,7 +619,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -655,7 +648,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 bbd01689d096..df5991b37a8f 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -374,6 +370,10 @@ def list_by_virtual_wan( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d9c1853f4789..468703d567c5 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f87d82c252ce..39eb2559a809 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 39339af3c563..2c66da816beb 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 eb8ca4fae32d..a99b36c2402b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8403ccf2dc4b..d28c515a3f70 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1d94ff50d7a6..143b5b641c24 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 74de7e53af05..397fe489cb7b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7275ff416a46..91b2d487d59d 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 41b54f8a939c..3ec45a54d2f5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b93871b69887..377b449d995b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 10dfcac74555..ce5149dbd17a 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f4050fe075f7..b3140b2ffd73 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 35098615717c..05e8c94f2ae0 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8df29c684c5a..e60aa141e9e6 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 fadc78648aeb..6177f9f05815 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -734,7 +728,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +747,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -815,8 +808,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -840,7 +833,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -870,7 +862,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -938,8 +930,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -963,7 +955,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -993,7 +984,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,8 +1051,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1083,7 +1074,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1108,7 +1098,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1172,8 +1162,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1197,7 +1187,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1223,7 +1212,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1322,7 +1311,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1345,8 +1333,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1368,7 +1356,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1393,7 +1380,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1457,8 +1444,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1481,7 +1468,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1507,7 +1493,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1574,8 +1560,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-10-01" @@ -1599,7 +1585,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1629,7 +1614,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1719,7 +1704,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1742,7 +1726,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1846,7 +1830,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 4b557ce2b7ad..cca10b14a1a5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d7c20e2a1034..dcd71509a2f4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( tap_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 866575d034b9..43a3eb405ba7 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -629,7 +624,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -670,6 +664,10 @@ def list_usage( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -683,15 +681,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4b81697ba814..119d67411cd7 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6ba173a48be4..5a1a674e0c9a 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 080a2f5b4f88..5e8c3658cdd9 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -479,6 +473,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -491,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -545,6 +539,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -556,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d8ea740f8b76..f61a71ba1f3c 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 8f28f44372c5..26f8efa781e4 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c97cd4913347..21480013acdf 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 @@ -116,11 +116,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -129,11 +127,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -141,6 +137,6 @@ "call": "resource_group_name, virtual_wan_name" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_application_gateways_operations_async.py index 97bd60fa40f4..4bad3e39e7ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -960,7 +951,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1009,7 +999,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1058,7 +1047,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1106,7 +1094,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1140,6 +1127,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1151,15 +1142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1221,7 +1208,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_application_security_groups_operations_async.py index 7ea7bf1ed9fa..e861a881054d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -352,7 +348,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -379,7 +374,7 @@ async def begin_update_tags( application_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -394,8 +389,8 @@ async def begin_update_tags( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -455,6 +450,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -466,15 +465,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -533,15 +532,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_delegations_operations_async.py index d5aca310640e..b43853bd9ea8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_endpoint_services_operations_async.py index aa55eaf40c47..ca8d09b39b1f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 94288525f3b0..774df228cc9d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 4d3b24381e96..7dff9d15d9be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_azure_firewalls_operations_async.py index d4179ecd1ee1..e3b5f2d61f3a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_bgp_service_communities_operations_async.py index 789225d43b85..589375d5beea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_connection_monitors_operations_async.py index 2c06bf4b3db4..91bdc1857735 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -368,7 +364,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +384,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -404,8 +399,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -474,7 +469,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -510,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -581,7 +575,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -591,7 +584,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -610,7 +602,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -625,8 +617,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -692,6 +684,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -705,15 +701,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_ddos_custom_policies_operations_async.py index ddd100a96f50..adaf9760468d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -350,7 +346,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -377,7 +372,7 @@ async def begin_update_tags( ddos_custom_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -392,8 +387,8 @@ async def begin_update_tags( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_ddos_protection_plans_operations_async.py index a31f14950a49..fc7ed4274f9d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( ddos_protection_plan_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_default_security_rules_operations_async.py index 574893e78346..85a2801dc19c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 0d250b805e3c..e1fae3a9ed7f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index 012aea1a61dc..4621fca3328a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 9fc7e0855f25..73db2cfbd481 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuits_operations_async.py index 83de78a03a79..f7c79b681014 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_connections_operations_async.py index 3e7554a615a4..afb1bab1335b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index 98226e32c17e..08566c6f3164 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_cross_connections_operations_async.py index ccdeec361830..a6d58319fda8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_gateways_operations_async.py index b949de18df43..ca27d49aa86b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_links_operations_async.py index dff0d1346924..15803d51939d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_ports_locations_operations_async.py index 6945786957d7..9b7bda7ddab7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_ports_operations_async.py index e4cf6f964c94..91dc35259cb0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( express_route_port_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_service_providers_operations_async.py index 333febb7b1bf..441ecc11bb32 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 987d4a8b836c..2981f09a5e5e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py index c2ae06344317..90715f31c518 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_interface_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_interface_endpoints_operations_async.py index 28f73869dd65..86eee3a0a876 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_interface_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_interface_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, interface_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( interface_endpoint_name: str, parameters: "models.InterfaceEndpoint", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: InterfaceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.InterfaceEndpoint + :return: An instance of AsyncLROPoller that returns either InterfaceEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.InterfaceEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_by_subscription( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index de04ab47e434..63d7adb9808c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index c3a5de0f9b29..2b401e555dc2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 33e2670068dc..54844fed1d4d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 44600c070255..c7fcbbf84b7f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 523e77510999..37bfbb90123f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_probes_operations_async.py index 1d45d969892e..1a7dd2fe465c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancers_operations_async.py index bd8336cb9d6b..063a9eb89431 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_local_network_gateways_operations_async.py index 136f0167b0b3..f4a5308cd3f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index dd086833053a..46aa3c6f37d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index 144d5884011f..d8fe3ebf90dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 00e3b1f28d5e..c1d712d5c0b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interfaces_operations_async.py index 6a3d863d4654..8969e8f89a73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_management_client_operations_async.py index 719d8ec873b6..3708552cb31f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -117,7 +116,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_profiles_operations_async.py index d8ffad7cb4ef..794ccd60eb72 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_security_groups_operations_async.py index 10e84b6e4e02..0809b21a3cd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_watchers_operations_async.py index 8968f897527d..81ec63fa93e9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": + ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1847,8 +1819,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_operations_async.py index 52dfd5e8803b..e2939d0aaa4d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index aa13d34b27c0..4fdcf403e22d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, p2_s_vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -304,8 +299,8 @@ async def begin_update_tags( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,7 +370,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,7 +389,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -408,8 +402,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -468,6 +462,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +478,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -533,6 +527,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -544,15 +542,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,8 +580,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -611,7 +605,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -640,7 +633,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -656,8 +649,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py index 111ff7718e3e..b95e2d55e0b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( p2_s_vpn_server_configuration_name: str, p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: P2SVpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.P2SVpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either P2SVpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.P2SVpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list_by_virtual_wan( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_packet_captures_operations_async.py index 285d6d02e5c2..558758f47e05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_public_ip_addresses_operations_async.py index e70eb7cae08e..3e3a43896ec7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_public_ip_prefixes_operations_async.py index a484842e4182..9b99b8caf8bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_filter_rules_operations_async.py index 2e3eb0ef05b3..5d6f846259c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_filters_operations_async.py index 02e58cbb5c0f..471446fdf1cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_tables_operations_async.py index 972a572dade7..72c6d3cc2a53 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_routes_operations_async.py index 901d9cd41bd4..a6de7c32b76e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_security_rules_operations_async.py index dd49ced53ca0..c86d1a04f078 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_service_endpoint_policies_operations_async.py index 6027fa73ebd3..29d366a3e812 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index a8145306493b..5e063a73a7dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_subnets_operations_async.py index 6aaff5e4fbdc..86b40fe3de8b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_usages_operations_async.py index 54b2af737357..49d7e2c5dfd1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_hubs_operations_async.py index 0e0e60e0b6f8..c4f0808728a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 2f8ac3e4261a..9d180b89eb31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py index e3d9ddb17242..3302b573708e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -718,7 +712,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -737,7 +730,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -751,8 +744,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,8 +790,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -822,7 +815,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -851,7 +843,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -868,8 +860,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -918,8 +910,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -943,7 +935,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -972,7 +963,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -989,8 +980,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1038,8 +1029,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1061,7 +1052,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1085,7 +1075,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1099,8 +1089,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1148,8 +1138,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1173,7 +1163,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1198,7 +1187,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1213,8 +1202,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1296,7 +1285,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1318,8 +1306,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1341,7 +1329,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1365,7 +1352,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1379,8 +1366,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,8 +1415,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1452,7 +1439,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1477,7 +1463,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1493,8 +1479,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1543,8 +1529,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1568,7 +1554,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1597,7 +1582,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1614,8 +1599,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1686,7 +1671,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1708,7 +1692,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1723,8 +1707,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1811,7 +1795,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 93bd50d74b3a..71ed86ff3850 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_taps_operations_async.py index c147b2f15014..82036f69917d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( tap_name: str, tap_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_networks_operations_async.py index 70a16b46e60e..a0cda5a9b7a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -615,7 +610,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -655,6 +649,10 @@ def list_usage( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -668,15 +666,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_wans_operations_async.py index 77fb844ed063..1331d62cb2f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_connections_operations_async.py index 1def3d82d02d..e48f867639a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_gateways_operations_async.py index 8a281c6f6e0d..d0ab71fd3336 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,6 +461,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -479,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -532,6 +526,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -543,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 46fac227e528..29769dc9af2c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_sites_operations_async.py index 3a94bbc6ea03..2128feb89a78 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_11_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_11_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): 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 cd325620678c..4a0d52b384ac 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -981,7 +972,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1031,7 +1021,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1081,7 +1070,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1130,7 +1118,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1165,6 +1152,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1176,15 +1167,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1247,7 +1234,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 52cda04a894b..ddfef5a46cd9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -362,7 +358,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -390,7 +385,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -467,6 +462,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -478,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -546,15 +545,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c9375e84c51c..f80e9690fcd7 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d528590228e5..4144d456a0c5 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 749e174846f9..b5273220f577 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 307b257ed3fe..d60261fd5469 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8db08fd77107..765ee4de1a70 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a44e96c8e815..1e195d2d51af 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8c572a928176..50e664cc9277 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -378,7 +374,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +395,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -486,7 +481,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -595,7 +589,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -605,7 +598,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -625,7 +617,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -708,6 +700,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -721,15 +717,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 62d2708fc746..bf86cdc79db5 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -360,7 +356,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -388,7 +383,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. 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 b38966fc34d7..25e165479770 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d7d97311914b..79deedb82cf3 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 246bb0bf928c..2d840647610b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 de73b96a0795..7af3964ce6cf 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 247c8da3aedd..1eff7752601a 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4cd7d5a5805a..d65f08791c5c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 02444c21d102..3b1e39925c19 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 04ac0a9091a1..7219f7659ff7 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 60e4bbe373a8..aec4abdedea5 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 dd765a176f29..c0a54bd6b3c1 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 2ca829b33ab3..136c54d372de 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 99ca630605c8..8ad0f117520c 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 aa4bb4159075..9472b047c5bf 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bc3a9efd90b4..978bdd7956b4 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1cd4f8cb5a2f..70fbf7b4f6e8 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9f75288270dd..c25ed97c4210 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 c1b18a68813a..bd2c3a5f4ce2 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( interface_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_by_subscription( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d61e271ee3f1..44623d7d304e 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 477b8a448420..d5d6b2f3d7fe 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 f26b3e9c46e2..5618e31e6c53 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 fab830d6d80d..e889aaa1ce19 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3ea22687e7ae..886d1bd26ab5 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3c327540762b..366e25840012 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 32e38f0c1c4e..e41846cd3d91 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aee173e7fa73..dd5a54737c2d 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dcedc91f9765..e3f3c50e8387 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 60eae930d0c2..73aecf4df805 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 57000ec18d4c..756477b9c129 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1ff9ae11df95..b59d4a87cfa9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 4ea0e3bbd3a6..77d72ce14d68 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -123,7 +122,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 26849682314b..7a24c721ba9e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ae13a8aa38a9..cc4d64c49c9f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a8bd6c76c1e1..089cfdca3aab 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. 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 c782080ad288..04e58d47b9fa 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 449f6c5a760f..6bb0829e1179 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( p2_s_vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -385,7 +380,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,7 +400,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -480,6 +474,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -546,6 +540,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -557,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,8 +594,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -625,7 +619,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -655,7 +648,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 fcca4aa9d27e..97994dd1a49c 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -374,6 +370,10 @@ def list_by_virtual_wan( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ec159d83be80..9f2951555095 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f274de797cc1..a1bc1b306dc3 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 4d3e28f7425d..8a52b4d78817 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fcd8a33a0f1e..e60297adbd32 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aeece591c512..f41fd0191fd0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dd89a4a0c0d8..e6b66be1dc6e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ef301768d7d7..a0e0028d43f3 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 113263260db8..6e38cdf3e240 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 78d3f556e9b4..4dcb7a189fe2 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1f5257174f4f..5a413e6c6332 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 631c73e3436f..2276ce0b5647 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -374,6 +370,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4277aee54f9e..37d3cc21371d 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 367dc261d929..b9a1739b6bc7 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9e7b9d098c92..28d2891b2c32 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 12f72b620b95..c37d656a5cb3 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -734,7 +728,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +747,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -815,8 +808,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -840,7 +833,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -870,7 +862,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -938,8 +930,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -963,7 +955,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -993,7 +984,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,8 +1051,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1083,7 +1074,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1108,7 +1098,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1172,8 +1162,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1197,7 +1187,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1223,7 +1212,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1322,7 +1311,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1345,8 +1333,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1368,7 +1356,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1393,7 +1380,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1457,8 +1444,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1481,7 +1468,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1507,7 +1493,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1574,8 +1560,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-01" @@ -1599,7 +1585,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1629,7 +1614,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1719,7 +1704,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1742,7 +1726,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1846,7 +1830,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 b9899a93d745..64e3ebd1088b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2441bba62500..0acd4a233748 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( tap_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ba65c9d6bec3..f5931a258439 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -629,7 +624,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -670,6 +664,10 @@ def list_usage( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -683,15 +681,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a26ad5937d46..ede8fef2c011 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 771aaec5205e..1ffead3d861b 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f3e6da3f700c..87897dddc568 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -479,6 +473,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -491,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -545,6 +539,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -556,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c091270bac7f..62184167ec24 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 e2c779544eba..1c34322a2b02 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 739feed18731..ff03725aa949 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 @@ -118,11 +118,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -131,11 +129,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -143,6 +139,6 @@ "call": "resource_group_name, virtual_wan_name" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_application_gateways_operations_async.py index 021f3fa77b3a..dc712aec44fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -911,7 +903,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -960,7 +951,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1009,7 +999,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1058,7 +1047,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1106,7 +1094,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1140,6 +1127,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1151,15 +1142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1221,7 +1208,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_application_security_groups_operations_async.py index 6c3681b9dcf2..68aed773bea5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -352,7 +348,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -379,7 +374,7 @@ async def begin_update_tags( application_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -394,8 +389,8 @@ async def begin_update_tags( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -455,6 +450,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -466,15 +465,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -533,15 +532,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_delegations_operations_async.py index b1bb89900846..70965983bda0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_endpoint_services_operations_async.py index b399ebb7fec6..bb52c3740e0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 2fab7d8fd9a3..5625f3cfb00c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index b43fd849cc4d..cd067f08fa00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_azure_firewalls_operations_async.py index f4702b5ab7db..527ab0713c62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_bgp_service_communities_operations_async.py index a536df4d8371..f761938f1187 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_connection_monitors_operations_async.py index 90a4f18125fe..59c746804320 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -368,7 +364,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +384,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -404,8 +399,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -474,7 +469,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -510,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -581,7 +575,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -591,7 +584,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -610,7 +602,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -625,8 +617,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -692,6 +684,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -705,15 +701,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_ddos_custom_policies_operations_async.py index ee6cf8404bcf..eeacc319e6ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -350,7 +346,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -377,7 +372,7 @@ async def begin_update_tags( ddos_custom_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -392,8 +387,8 @@ async def begin_update_tags( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_ddos_protection_plans_operations_async.py index 2874cdea1a21..1ecd916ba153 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( ddos_protection_plan_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_default_security_rules_operations_async.py index 79e2aef67247..17e6995b16c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index a032f709a4f9..5524495b421b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index 36270de75814..6aa156467775 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index f1130fcf98fe..7927e8f263e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuits_operations_async.py index 279957323787..55fc6d0d9216 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_connections_operations_async.py index 79b0155c3573..8af304f768a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index e711f826406a..95c99e03ff8c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 6842c1ae905b..0d8930f49f7c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_gateways_operations_async.py index e75d088ed304..e1a7edb2c5dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_links_operations_async.py index 7a498fd8cabd..ed01e415ec19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_ports_locations_operations_async.py index b706f32e113b..9505079771bc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_ports_operations_async.py index 7953487d46fb..c9734e04515b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( express_route_port_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_service_providers_operations_async.py index e60177f2b7da..4df5292d61c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index fdbd69c03bc4..65515fcb21a5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 34d473c68022..2a0714865d31 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_interface_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_interface_endpoints_operations_async.py index dc1c99d0c233..6a7b0f00c941 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_interface_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_interface_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, interface_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( interface_endpoint_name: str, parameters: "models.InterfaceEndpoint", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: InterfaceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.InterfaceEndpoint + :return: An instance of AsyncLROPoller that returns either InterfaceEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.InterfaceEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_by_subscription( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 2d0a7de0744e..6349eb50543e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index a5ad24f77c7d..00012c188887 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 5cc14327ad18..630b263a5e94 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index d9cc05b6731a..a10418d0d182 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 3c87e5f10b80..67aa868b9a4e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_probes_operations_async.py index f3499337be10..c428ee26ddaf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancers_operations_async.py index 8fb939e20c36..820bbfd4bcbc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_local_network_gateways_operations_async.py index 07e18b554a8f..2a9e7f1f5208 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index f63f0359c8d5..d930c52ce620 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index be93e225c420..8c12dd8575b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 556e655f1d81..528fb329a3c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interfaces_operations_async.py index daaf4eeeae49..9bf51b50b435 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_management_client_operations_async.py index 33ef6c16661e..ff92d1e26fde 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -117,7 +116,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_profiles_operations_async.py index 6690922ac262..830fb9b91921 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_security_groups_operations_async.py index 501ffa7b03c7..954b070cc6cb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_watchers_operations_async.py index e5ed5c0b7355..7529e786402c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": + ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1847,8 +1819,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_operations_async.py index b78160ec58b3..5d56a1d90bf2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index 7ed16712f984..6a49b9535342 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, p2_s_vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -304,8 +299,8 @@ async def begin_update_tags( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,7 +370,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,7 +389,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -408,8 +402,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -468,6 +462,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +478,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -533,6 +527,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -544,15 +542,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,8 +580,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -611,7 +605,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -640,7 +633,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -656,8 +649,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py index 912211975863..0eba6cec85dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( p2_s_vpn_server_configuration_name: str, p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: P2SVpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.P2SVpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either P2SVpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.P2SVpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list_by_virtual_wan( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_packet_captures_operations_async.py index e4279b949942..2140d2b089f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index 604eadf334a0..ec41e620f0d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_public_ip_addresses_operations_async.py index 0e3b8649fcbe..645f0ed60da7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_public_ip_prefixes_operations_async.py index f793063e7b65..40b393901ce1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_filter_rules_operations_async.py index 4e461fa82c85..118251de6957 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_filters_operations_async.py index 5599570def7b..680d48948132 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_tables_operations_async.py index 07381f443ce9..cc9ed03880eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_routes_operations_async.py index 2dda67e1183c..7e5d8df1bbe5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_security_rules_operations_async.py index 1d73dd06aef5..41030a6c75b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_service_endpoint_policies_operations_async.py index 04d6b9e82c56..c25a94038014 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index a00f259f0031..81d895421b33 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_subnets_operations_async.py index 37ae79581126..f20d5441a280 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -481,6 +476,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -494,15 +493,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_usages_operations_async.py index 08a225c1ef23..e316c7fd4b1b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_hubs_operations_async.py index b6fde8f263cf..466b9d4c613a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index bf812bce5515..384a0ffbc7d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 850562729b41..a2e79536223c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -718,7 +712,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -737,7 +730,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -751,8 +744,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,8 +790,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -822,7 +815,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -851,7 +843,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -868,8 +860,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -918,8 +910,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -943,7 +935,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -972,7 +963,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -989,8 +980,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1038,8 +1029,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1061,7 +1052,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1085,7 +1075,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1099,8 +1089,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1148,8 +1138,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1173,7 +1163,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1198,7 +1187,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1213,8 +1202,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1296,7 +1285,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1318,8 +1306,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1341,7 +1329,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1365,7 +1352,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1379,8 +1366,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,8 +1415,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1452,7 +1439,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1477,7 +1463,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1493,8 +1479,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1543,8 +1529,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1568,7 +1554,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1597,7 +1582,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1614,8 +1599,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1686,7 +1671,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1708,7 +1692,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1723,8 +1707,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1811,7 +1795,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 5eb75255e2c1..cd7dcdfcace3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_taps_operations_async.py index f6995f7e771b..4f4cb3042b0e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( tap_name: str, tap_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_networks_operations_async.py index d977b4f81e30..2bee59284948 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -615,7 +610,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -655,6 +649,10 @@ def list_usage( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -668,15 +666,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_wans_operations_async.py index 563bac3fe1ad..ba63e2c180fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_connections_operations_async.py index c68f1acb84ac..187e9b2545fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_gateways_operations_async.py index ee1a6dc0c0ce..50b6a99c888b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,6 +461,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -479,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -532,6 +526,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -543,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index ac32c261fbb7..839bb970c7ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_sites_operations_async.py index c6dba02554ad..2defd9c75ecf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2018_12_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_12_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index d0a2d5714403..71209b0e5e3f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] 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 633d50b73a9b..6d6118acc708 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -931,7 +923,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -981,7 +972,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1031,7 +1021,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1081,7 +1070,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1130,7 +1118,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1165,6 +1152,10 @@ def list_available_ssl_predefined_policies( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1176,15 +1167,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1247,7 +1234,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d4e194643b5e..8c4e00fd17ec 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -362,7 +358,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -390,7 +385,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -467,6 +462,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -478,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -546,15 +545,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5a6dee997c03..2dc6fd1ae62a 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aaf4ae093a99..e0f0b4b72ea6 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7e926108c201..635a2a6a2a40 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 25e5cc3f25e2..d1d3cbd226bc 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 da9ab4e963dd..40abc1c14492 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d953df7be021..09bb79c57daf 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fea26df0a1d4..100a24d88993 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -378,7 +374,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +395,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -486,7 +481,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -595,7 +589,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -605,7 +598,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -625,7 +617,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -708,6 +700,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -721,15 +717,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 85d3280a2f60..ef28f7ee7d4e 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -360,7 +356,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -388,7 +383,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. 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 2b541794f1fc..5b2f7134bff5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fdff53a408a8..e787c1e4a594 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 58cb3d69303f..c11109333863 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0ef2d8999524..cbfa9da21f67 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1c767b0d8bfd..70b64c45f148 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 100685954a0e..3b217f1129df 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fb1a1b8b72b7..f2a69c173df1 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 2a18bb34c279..4dac856941c8 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 8f58b81d4924..8380f2d523e5 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 4a80915209d3..f1a47351db59 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 4a4311c69d72..beaef0e6d506 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 25bae72aebeb..6d8142841387 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 @@ -65,6 +65,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 7402283103ed..c3805f5ed727 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a419695e4a59..e487ad2ace10 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 84fc6847829c..9a30a2e3d9ab 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6509a93d2c2c..eba4b589360d 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 @@ -71,6 +71,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 b2d4ee18d6d8..f80d9b3f643a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( interface_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_by_subscription( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6b49292f1335..53150b0ee877 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 0fa16b43694b..378c053dc683 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 83614c785426..db3ff1da7e14 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 b1b337bd3d22..6c44f5d34124 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 107bbc5b4704..d40b88197a1b 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e01385c07376..491b44c1511f 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 93ddd1cf5dad..705b8d5d124d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 082a10e99d48..b6bebec0fbfc 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6aef6eb60503..d9523f51183b 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 cb72ad96fc2b..d369ae55c6f6 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 @@ -69,6 +69,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bb206293e3c1..39acc5d548b8 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e5d4286cb2d3..d4f455a96f9c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 495a3ac8730f..9b0ca0354279 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -123,7 +122,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 da0033e6878f..f91421d78411 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f2a76ef948f5..27d21d6c71e0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f2178b6b1ec3..02a9d77fe344 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. 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 53c28b2f95f3..0d168ec2dd14 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 @@ -63,6 +63,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e312718dc074..a8412a265731 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( p2_s_vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -385,7 +380,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,7 +400,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -480,6 +474,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -546,6 +540,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -557,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,8 +594,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -625,7 +619,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -655,7 +648,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 8e82c5cd640d..97eb4c1e1d77 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -374,6 +370,10 @@ def list_by_virtual_wan( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0f2bd9ebffcd..9542b7eaa0bb 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 32e56040873a..18ee6a5a1993 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7d162254fff1..1bc05e8f1c80 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 b9e5da77283d..ea1a2d989413 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0d78862bacb0..66f68e62cf96 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fffe2195d4fd..606ec749b397 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8ed112b5040f..5fd96584c0d0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 322a369f031c..dc8cb28ece19 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fbadd65596a0..f60df6b0de76 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 28ec8363d28f..411f6e60c574 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5e35e337c8f3..7acb9acd7b42 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6f126e5ca1a8..7251d761f4bc 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -493,6 +488,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -506,15 +505,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4737a82e8460..1f805bab230e 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 @@ -66,6 +66,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ba691e972a2f..87ebda58ec39 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0d302cea9984..a3dd00841925 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 e6de64c1ce49..6ca4c318b826 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -734,7 +728,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +747,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -815,8 +808,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -840,7 +833,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -870,7 +862,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -938,8 +930,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -963,7 +955,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -993,7 +984,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,8 +1051,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1083,7 +1074,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1108,7 +1098,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1172,8 +1162,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1197,7 +1187,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1223,7 +1212,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1322,7 +1311,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1345,8 +1333,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1368,7 +1356,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1393,7 +1380,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1457,8 +1444,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1481,7 +1468,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1507,7 +1493,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1574,8 +1560,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2018-12-01" @@ -1599,7 +1585,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1629,7 +1614,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1719,7 +1704,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1742,7 +1726,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1846,7 +1830,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 b51f0c2ce03f..a0b130a2eabf 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b52624c794d9..90b5fe254c0d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( tap_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 60bde8644ec5..35f3b33e3ced 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -629,7 +624,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -670,6 +664,10 @@ def list_usage( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -683,15 +681,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9d561813852a..f38850536a5c 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 84a7d1b51b64..32b17015de3c 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 eebeb33f2cea..0b1b3efdedd5 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -479,6 +473,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -491,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -545,6 +539,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -556,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7855df9ef702..6a4dcd776f2e 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 06bde8f0a656..0ddabfbb4268 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0cd4d1bc8866..eaba575e0db2 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 @@ -68,6 +68,10 @@ def list( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2018-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 d7d60075d5d0..1a296417fb69 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 @@ -121,11 +121,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -134,11 +132,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -146,6 +142,6 @@ "call": "resource_group_name, virtual_wan_name" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_application_gateways_operations_async.py index bbde23ed8702..4e1186f10638 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -887,8 +879,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -914,7 +906,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -944,7 +935,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -962,8 +953,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1038,7 +1029,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1136,7 +1125,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1185,7 +1173,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1233,7 +1220,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1267,6 +1253,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1278,15 +1268,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1348,7 +1334,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_application_security_groups_operations_async.py index df14b88bbf7e..d552759b0698 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -352,7 +348,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -379,7 +374,7 @@ async def begin_update_tags( application_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -394,8 +389,8 @@ async def begin_update_tags( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -455,6 +450,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -466,15 +465,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -533,15 +532,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_delegations_operations_async.py index fd88da5070b1..00029d3096d9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_endpoint_services_operations_async.py index 9962832539e6..1286163871cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 50d8c016fd6f..edf777dc464a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 671437347cfb..00c423755320 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_azure_firewalls_operations_async.py index a38e3f98e53a..0d46f41ac13f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_bgp_service_communities_operations_async.py index 43ed0dda5fe7..470a33c1b286 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_connection_monitors_operations_async.py index db072d60f594..93a601aca60c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -368,7 +364,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +384,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -404,8 +399,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -474,7 +469,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -510,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -581,7 +575,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -591,7 +584,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -610,7 +602,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -625,8 +617,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -692,6 +684,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -705,15 +701,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_ddos_custom_policies_operations_async.py index c4b015bd4ba1..eab34c941d27 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -350,7 +346,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -377,7 +372,7 @@ async def begin_update_tags( ddos_custom_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -392,8 +387,8 @@ async def begin_update_tags( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_ddos_protection_plans_operations_async.py index 82663ef283bd..ab5fcee5fcf7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( ddos_protection_plan_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_default_security_rules_operations_async.py index 87efb66d6e64..773f6064ad15 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 9a23ef72c46c..3f541d83b2e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index f6ae89357360..82d8a5e282aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 8a4ac382d8ef..4871c9f19728 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuits_operations_async.py index 226534055aac..3410cecc8a55 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_connections_operations_async.py index 2e18957b3530..ecb5df6f7027 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index 4b8cd1391dc2..6b0873c193b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_cross_connections_operations_async.py index d988fee7d942..38e4b3e895ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_gateways_operations_async.py index ac4e4921827a..db81742bdb60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_links_operations_async.py index 2828bd7478e4..72ed45b4bc40 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_ports_locations_operations_async.py index 3c99795553d2..86208d788ec3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_ports_operations_async.py index d48b2bf2577d..7d842a192502 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( express_route_port_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_service_providers_operations_async.py index 0b32cd034db3..54563d96329c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 0909e448da40..3322ba6f099c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 3d2bd67b978a..6d02155525e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_interface_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_interface_endpoints_operations_async.py index defcce228e58..810065319c5e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_interface_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_interface_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, interface_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( interface_endpoint_name: str, parameters: "models.InterfaceEndpoint", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: InterfaceEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.InterfaceEndpoint + :return: An instance of AsyncLROPoller that returns either InterfaceEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.InterfaceEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_by_subscription( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 1321304cf650..d144a6dbab86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 5df41e795e78..da366be8dd07 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 60fca6583899..b25794f6a216 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index a26d0dabaa3d..dace96b05028 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index ed472f6baa04..bfdec28865cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_probes_operations_async.py index 4504aa205a9c..72ba3972c5a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancers_operations_async.py index 0b30ef8cfdd6..207432be912c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_local_network_gateways_operations_async.py index c0eeda2a9fc9..f543f65237a7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_nat_gateways_operations_async.py index 1e3a5f1af84c..02367d252e29 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 5665157feb02..9783dec8d48c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index 293493818201..b2e6e861bc67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index afae35191e2f..cd7aa6e84e3f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interfaces_operations_async.py index 40993d9e482e..d59675c1fd2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_management_client_operations_async.py index 6c4b6ff8d83d..e722d45698d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -117,7 +116,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_profiles_operations_async.py index 9ab2946a07a1..8948e1823312 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_security_groups_operations_async.py index 2d025c0fc8aa..1b2cf3c0766c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_watchers_operations_async.py index 224f47beaaee..e300e17c3021 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": + ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1847,8 +1819,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_operations_async.py index cd9745e342b5..e437e4c77004 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index b60e853f3b49..e25872a34f62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, p2_s_vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -304,8 +299,8 @@ async def begin_update_tags( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,7 +370,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,7 +389,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -408,8 +402,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -468,6 +462,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +478,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -533,6 +527,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -544,15 +542,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,8 +580,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -611,7 +605,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -640,7 +633,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -656,8 +649,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py index 2370aaf9087b..25965f39686c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( p2_s_vpn_server_configuration_name: str, p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: P2SVpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.P2SVpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either P2SVpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.P2SVpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list_by_virtual_wan( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_packet_captures_operations_async.py index a4b9335d1cce..0147ab3bf916 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index ec3bdbc4096b..23203472f9a6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_public_ip_addresses_operations_async.py index 4f8aa1181cfc..4cbd1fefb562 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_public_ip_prefixes_operations_async.py index f1b731e405ad..f54107530bc3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_resource_navigation_links_operations_async.py index 68bc524be2ff..6422a822bf5d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_filter_rules_operations_async.py index ead723d54c5f..4f4f8300cef5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_filters_operations_async.py index 10fbf8705a15..198c587585ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_tables_operations_async.py index 51ccc813c894..4c473c4c17f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_routes_operations_async.py index a4522229d8a7..3d3b4f053357 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_security_rules_operations_async.py index 7b175a681cdc..d672acf4d4df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_association_links_operations_async.py index 5764983bde79..43cb5e799ca9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_endpoint_policies_operations_async.py index ed6f9ce39bd4..b0adaedb7781 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index 2aeed655ca7b..bac2b47e206d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_subnets_operations_async.py index d9e3638998e2..6d73df30ab88 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -481,6 +476,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -494,15 +493,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_usages_operations_async.py index cb503b2d2ff1..4f4bc15e1b87 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_hubs_operations_async.py index b2ade3268bb8..23b0f819661e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index b2670f11aa98..e367c6ba584c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_gateways_operations_async.py index cf3b662684aa..b2ce407cc934 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -718,7 +712,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -737,7 +730,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -751,8 +744,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,8 +790,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -822,7 +815,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -851,7 +843,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -868,8 +860,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -918,8 +910,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -943,7 +935,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -972,7 +963,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -989,8 +980,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1038,8 +1029,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1061,7 +1052,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1085,7 +1075,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1099,8 +1089,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1148,8 +1138,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1173,7 +1163,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1198,7 +1187,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1213,8 +1202,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1296,7 +1285,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1318,8 +1306,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1341,7 +1329,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1365,7 +1352,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1379,8 +1366,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,8 +1415,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1452,7 +1439,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1477,7 +1463,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1493,8 +1479,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1543,8 +1529,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1568,7 +1554,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1597,7 +1582,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1614,8 +1599,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1686,7 +1671,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1708,7 +1692,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1723,8 +1707,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1811,7 +1795,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_peerings_operations_async.py index f84f1b614a5b..73f43fb59452 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_taps_operations_async.py index 4939d85b1541..47283bf96661 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( tap_name: str, tap_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_networks_operations_async.py index 83715d48cce7..6cc5fccde541 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -615,7 +610,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -655,6 +649,10 @@ def list_usage( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -668,15 +666,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_wans_operations_async.py index b6018d054a7f..385cae107c55 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_connections_operations_async.py index b723cbfc7438..91cd493b6430 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_gateways_operations_async.py index aef496bab7d2..86d7005e4874 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -467,6 +461,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -479,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -532,6 +526,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -543,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 277a84d88262..23552901239b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_sites_operations_async.py index ffd987987c42..f2bcb5e5b76a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_02_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_02_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index 231abe4a7e42..5e63c8b5f16b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] 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 5181b4723de5..b9e1a5a268af 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -907,8 +899,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -934,7 +926,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -965,7 +956,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,7 +1051,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1160,7 +1149,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1210,7 +1198,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1259,7 +1246,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1294,6 +1280,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1305,15 +1295,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1376,7 +1362,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 db3954fd5962..2b3933d378bd 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -362,7 +358,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -390,7 +385,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -467,6 +462,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -478,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -546,15 +545,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 20b650d27220..b9447a730d6c 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e9d8fe25c43b..1a4a6e7422b7 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 94a7d3d00038..e835cb70e706 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 665d588c86a9..6cd0ba0df99f 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 67de964a2015..c618fd84ae70 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c7907b2de6dc..1908258532d4 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b782136c5c1e..d971507f7090 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -378,7 +374,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +395,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -486,7 +481,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -595,7 +589,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -605,7 +598,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -625,7 +617,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -708,6 +700,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -721,15 +717,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f87eb8e38073..1ba8201c0e8f 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -360,7 +356,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -388,7 +383,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. 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 97475cefaf7f..c463316dafab 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0bf942997060..96bb17f474de 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 fd7b88ba9525..4235aa293463 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4c854d241178..c283c09a4c37 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3b46336aab3f..5d83e77995bc 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a56918379a19..467eb6cb9843 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3da4e6bcb513..d032c10a0754 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e8b2ba29b9ff..ec3b0b16e32c 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 9055523354b7..b7fd18162dca 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 b1cb8609eb6c..fde8a053a6ab 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 f4401daccc6f..082196c8649a 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ec27dba138e8..9946bbb39c21 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a7db100008f0..89978b845813 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 798c8c62498f..1a93d6e261ef 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4612ab645da3..b35ddda16a1c 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b0dea68c77ce..763467fe08be 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 13b0f573157c..695617cb4095 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( interface_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified interface endpoint. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'InterfaceEndpoint') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('InterfaceEndpoint', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.InterfaceEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -355,6 +351,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_by_subscription( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bf2344738029..0ea74012f793 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 30ff57544b60..27fc7dc61eb4 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 60360e9e3e76..0a72f4a74116 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 aa6bac65dd57..b4c5fa2934f7 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d8a96439d41d..39af07681318 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a2563fba53a3..ec982d5d7bdd 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 99ed4cad32a2..80d901f35ce6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 329ea8e54906..089d26605537 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2455ba83e224..8fad4834af46 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 faf7baeb137e..f60011f2fcc1 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8fe60cb21575..c973d1e27732 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a0a87e489b69..ebbbf5096366 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3d5bd702de2f..2913969451ea 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d845e36ae3bc..6ee6467ac2df 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -123,7 +122,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 30bcfd982c3c..9cf50dc013fe 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7c232707ec37..58a9785c0ce6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8d36bfe7c58d..1d048d5f4363 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. 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 0830049aae70..200234a0fc27 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 09c144aa3493..e082fdadfcb4 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( p2_s_vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -385,7 +380,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,7 +400,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -480,6 +474,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -546,6 +540,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -557,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,8 +594,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -625,7 +619,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -655,7 +648,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 59b01a2a05e4..047e75ac5372 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -374,6 +370,10 @@ def list_by_virtual_wan( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5063c199c59d..281a13245293 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a29a701aab14..df03cfb3a543 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 be5312fb1391..6b23a6677d0c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 954e88a83670..b10e95922718 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 51ab207c1c82..f387872369af 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 @@ -88,7 +88,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8d7bec844306..0ed42b36ce05 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b0bbf9509061..e44b8f55fe38 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e5d67f23a997..9ad30d51f19b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 029d0b4a0996..a26eb144da11 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 47bfa14dfe08..b2afd365e09f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 df5614827938..04d7f6dee053 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 @@ -88,7 +88,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 220fb9d5c8a6..5a4d5cb7a0b4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 44cbc8690320..9e145c51d2d0 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aaedb8ddfe73..aae0163a9fc3 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -493,6 +488,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -506,15 +505,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 17bd96aa359a..a165f234f329 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6a559b3df11a..10d281a5df8c 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8498b087c6f3..bfd7d2459d30 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 0d8b31fdfe97..79c5c4aba481 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -734,7 +728,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +747,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -815,8 +808,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -840,7 +833,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -870,7 +862,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -938,8 +930,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -963,7 +955,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -993,7 +984,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,8 +1051,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1083,7 +1074,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1108,7 +1098,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1172,8 +1162,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1197,7 +1187,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1223,7 +1212,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1322,7 +1311,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1345,8 +1333,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1368,7 +1356,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1393,7 +1380,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1457,8 +1444,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1481,7 +1468,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1507,7 +1493,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1574,8 +1560,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-02-01" @@ -1599,7 +1585,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1629,7 +1614,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1719,7 +1704,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1742,7 +1726,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1846,7 +1830,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content 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 4c7f36ce15f6..132947e2dfd6 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 906c077400ed..d46cbbcf41cd 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( tap_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8e19c0f9ad55..c64900afadbf 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -629,7 +624,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -670,6 +664,10 @@ def list_usage( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -683,15 +681,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 071c1954e6d6..8b9ad6bbdf42 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 99bc65976027..75340e6dce53 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0d530c919d51..8227f97656bd 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -479,6 +473,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -491,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -545,6 +539,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -556,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 124c7e253869..26acc3c8d03e 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 b960a1f6a7c5..429d8ce76f59 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0d6153d33004..a2067fb7970b 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 @@ -68,6 +68,10 @@ def list( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2019-02-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 1ce9c19fb106..807aabd7ec35 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 @@ -125,11 +125,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -138,11 +136,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -150,6 +146,6 @@ "call": "resource_group_name, virtual_wan_name" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_application_gateways_operations_async.py index 59e925b8ce44..8f854a8f23f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -887,8 +879,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -914,7 +906,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -944,7 +935,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -962,8 +953,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1038,7 +1029,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1136,7 +1125,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1185,7 +1173,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1233,7 +1220,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1267,6 +1253,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1278,15 +1268,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1348,7 +1334,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_application_security_groups_operations_async.py index 0f524405b061..80d0d8f9893f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -352,7 +348,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -379,7 +374,7 @@ async def begin_update_tags( application_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -394,8 +389,8 @@ async def begin_update_tags( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -455,6 +450,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -466,15 +465,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -533,15 +532,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_delegations_operations_async.py index b16894401d45..63da15a34490 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_endpoint_services_operations_async.py index 5906ce31cf6d..75a0ed1c33c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_private_endpoint_types_operations_async.py index 55e639481bba..7d8287de2039 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_private_endpoint_types_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -62,6 +62,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -146,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 90d5a338837e..99e01c6448eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 597fdf4afd55..a3934132121d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_azure_firewalls_operations_async.py index 550653dc96d8..d6b15492762d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -340,6 +336,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -352,15 +352,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -404,6 +400,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_bastion_hosts_operations_async.py index 2e4ac801bcde..1111ddedc99a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_bastion_hosts_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('BastionHost', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( bastion_host_name: str, parameters: "models.BastionHost", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_bgp_service_communities_operations_async.py index 86f8ef24937f..056d2eb443ed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_connection_monitors_operations_async.py index 1fb070856383..ba4ec6ce1855 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -368,7 +364,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +384,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -404,8 +399,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -474,7 +469,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -510,8 +504,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -581,7 +575,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -591,7 +584,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -610,7 +602,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -625,8 +617,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -692,6 +684,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -705,15 +701,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_ddos_custom_policies_operations_async.py index 694d4b372f25..bcbad7d16908 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -350,7 +346,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -377,7 +372,7 @@ async def begin_update_tags( ddos_custom_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -392,8 +387,8 @@ async def begin_update_tags( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py index 8a32b648a3b6..86f1bde3e23f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( ddos_protection_plan_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_default_security_rules_operations_async.py index 5e8046a67e5b..253991950b40 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index f467183060fc..5d53175a5c82 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index f366b0fe1759..a592e21bb367 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index dcc6878c9716..80e40e181bda 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuits_operations_async.py index 4a001f5363f1..b448d3781636 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_connections_operations_async.py index 611250f398e4..e42a96eac900 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index 9382f2634f1a..b23e7d966b00 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py index b36e895c45a1..b19098b005c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_gateways_operations_async.py index 601b9ef278c6..4735cf481edf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_links_operations_async.py index d5e385e4dca4..ca748785718b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_ports_locations_operations_async.py index daa9bb86c467..ed4634c0239f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_ports_operations_async.py index 5b6307630d2a..ef0fc3568ea3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( express_route_port_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_service_providers_operations_async.py index bd524ed4b55f..ced5b9790a8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index dfe795327f83..6714cf3b5bfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py index b1da0ec473d9..5268884d29d1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index c45b24c49b8e..b1fdfe3fada6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 4c8c55c261e7..ab83f29f9d18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 468812ca7856..576fc28a34e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index d4bff7a88842..a36012412bc4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 33e1d08400cd..36717476458c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_probes_operations_async.py index 903c6548fab6..46cb67a8779e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancers_operations_async.py index 73452f740097..8ba2a7e07dc6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_local_network_gateways_operations_async.py index c48d04a1c134..c08489e98b5a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_nat_gateways_operations_async.py index 056dbe9268a8..f1c36a9904ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 26e70be26a7c..8c7dd74b040a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index 949ccad6d999..a1f70cb2d60f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 1fd03abb4ec4..e690ff69c26f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interfaces_operations_async.py index 48e25413c335..fd622aaac04c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_management_client_operations_async.py index 658cfb7b1b77..641f858bfd86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -117,7 +116,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_profiles_operations_async.py index dc79fda7978c..fa81a520a961 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_security_groups_operations_async.py index 0bc782638943..2f4eabb470b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_watchers_operations_async.py index 593a8774b801..dfab24125570 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": + ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1847,8 +1819,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_operations_async.py index 9f9d01baa8f7..485dfb4c0a79 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index 246bcce3d385..a3d28d1c71d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, p2_s_vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -304,8 +299,8 @@ async def begin_update_tags( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,7 +370,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,7 +389,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -408,8 +402,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -468,6 +462,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +478,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -533,6 +527,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -544,15 +542,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,8 +580,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -611,7 +605,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -640,7 +633,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -656,8 +649,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -705,8 +698,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> Optional["models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -728,7 +721,6 @@ async def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -752,7 +744,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -766,8 +758,8 @@ async def begin_get_p2_s_vpn_connection_health( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py index 909e3aef50a2..56a322e27d16 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( p2_s_vpn_server_configuration_name: str, p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: P2SVpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.P2SVpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either P2SVpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.P2SVpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list_by_virtual_wan( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_packet_captures_operations_async.py index f500d924e826..a68f70edc74b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index fb6e06009e8b..d1f4b88d9ff3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_private_endpoints_operations_async.py index ed7f62c81560..204d6b4926a2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_private_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_private_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, private_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( private_endpoint_name: str, parameters: "models.PrivateEndpoint", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateEndpoint + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.PrivateEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_private_link_services_operations_async.py index 5c6e47bd6bf4..53b4e5b84581 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_private_link_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_private_link_services_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, service_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( service_name: str, parameters: "models.PrivateLinkService", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateLinkService, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateLinkService + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.PrivateLinkService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -508,7 +504,6 @@ async def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -559,7 +554,6 @@ async def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -580,7 +574,7 @@ async def begin_delete_private_endpoint_connection( service_name: str, pe_connection_name: str, **kwargs - ) -> None: + ) -> 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. @@ -595,8 +589,8 @@ async def begin_delete_private_endpoint_connection( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -636,31 +630,20 @@ def get_long_running_output(pipeline_response): 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 - async def check_private_link_service_visibility( + async def _check_private_link_service_visibility_initial( self, location: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": - """Checks 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.v2019_04_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + ) -> Optional["models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -676,7 +659,6 @@ async def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -685,46 +667,96 @@ async def check_private_link_service_visibility( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - async def check_private_link_service_visibility_by_resource_group( + async def begin_check_private_link_service_visibility( self, location: str, - resource_group_name: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": + ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: """Checks the subscription is visible to private link service. :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.v2019_04_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_04_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -741,7 +773,6 @@ async def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -750,17 +781,84 @@ async def check_private_link_service_visibility_by_resource_group( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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 the subscription is visible to private link service. + + :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.v2019_04_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.v2019_04_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -783,6 +881,10 @@ def list_auto_approved_private_link_services( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -795,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -854,6 +952,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -867,15 +969,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_public_ip_addresses_operations_async.py index eb2c8ffe9097..31b50b00cefc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_public_ip_prefixes_operations_async.py index 66a505cb51ac..6d3e4a7718a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_resource_navigation_links_operations_async.py index fb84e622711b..9497ada1ec34 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_filter_rules_operations_async.py index e59dce8fbe6b..2f953dbd7e45 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_filters_operations_async.py index 2283ee2fa118..8a9bec1b4600 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_tables_operations_async.py index e4b7f6969367..72e3e46a5528 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_routes_operations_async.py index ece4a3cb7402..40d399097c28 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_security_rules_operations_async.py index 7ac1ebfc2823..c7513d7f6d62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_association_links_operations_async.py index 195a6e6b82c2..efe9eba68956 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_endpoint_policies_operations_async.py index 5347f80007be..122a4c5c8ea8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index a7e4069b408e..bc5829fc2e54 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_tags_operations_async.py index 80e9ce260d22..50a2931d0e2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_service_tags_operations_async.py @@ -77,7 +77,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_subnets_operations_async.py index 38208b8e4307..e343ee382bdb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -481,6 +476,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -494,15 +493,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_usages_operations_async.py index 6f1dc98c9b9c..3b9b0ef4ac67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_hubs_operations_async.py index f1909a17c072..ee3b9c8d688e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 9d1a2ac8a714..0d3bf74ae984 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -382,7 +377,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -473,7 +468,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -486,7 +480,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -505,7 +498,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -523,8 +516,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +601,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -646,6 +638,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -658,15 +654,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -699,8 +691,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -724,7 +716,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -753,7 +744,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -772,8 +763,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 0b60fee50aba..5ea703dac535 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list_connections( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -540,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -581,8 +576,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -606,7 +601,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -631,7 +625,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -647,8 +641,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -718,7 +712,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -737,7 +730,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -751,8 +744,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -797,8 +790,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -822,7 +815,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -851,7 +843,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -868,8 +860,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -918,8 +910,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -943,7 +935,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -972,7 +963,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -989,8 +980,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1038,8 +1029,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1061,7 +1052,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1085,7 +1075,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1099,8 +1089,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1148,8 +1138,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1173,7 +1163,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1198,7 +1187,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1213,8 +1202,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1296,7 +1285,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1318,8 +1306,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1341,7 +1329,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1365,7 +1352,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1379,8 +1366,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,8 +1415,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1452,7 +1439,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1477,7 +1463,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1493,8 +1479,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1543,8 +1529,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1568,7 +1554,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1597,7 +1582,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1614,8 +1599,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1686,7 +1671,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1708,7 +1692,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1723,8 +1707,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1811,7 +1795,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1837,8 +1820,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientConnectionHealthDetailListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1860,7 +1843,6 @@ async def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1884,7 +1866,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1898,8 +1880,8 @@ async def begin_get_vpnclient_connection_health( 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: VpnClientConnectionHealthDetailListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnClientConnectionHealthDetailListResult + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnClientConnectionHealthDetailListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py index aa80bbf5f99e..ba2a00de77d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_taps_operations_async.py index 57b22fc1742e..e66ef729ebd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( tap_name: str, tap_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_networks_operations_async.py index c6c5d71a8ef0..18e7b9efdfd7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -615,7 +610,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -655,6 +649,10 @@ def list_usage( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -668,15 +666,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_wans_operations_async.py index dd34f063ffb8..a58811f1bde5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_connections_operations_async.py index 5439e2284cd6..b35f38e7df3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_gateways_operations_async.py index bb9f287dadd5..ac53b5690e0b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -452,8 +446,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> Optional["models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -475,7 +469,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -499,7 +492,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> "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. @@ -512,8 +505,8 @@ async def begin_reset( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -575,6 +568,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -587,15 +584,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -640,6 +633,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -651,15 +648,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 007fa14575f1..a5ae5e022544 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_sites_operations_async.py index a87b68023a04..244d1571f98d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_04_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index 56cef5d98d7e..8a1b15af43df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] 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 90e9923bff82..5c7b689dda20 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -907,8 +899,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -934,7 +926,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -965,7 +956,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,7 +1051,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1160,7 +1149,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1210,7 +1198,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1259,7 +1246,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1294,6 +1280,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1305,15 +1295,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1376,7 +1362,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c9bee48c53b4..9fe30bc68e43 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -362,7 +358,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -390,7 +385,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -467,6 +462,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -478,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -546,15 +545,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0b174560aa24..1583baa3773c 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c7b53bea4d93..1152686d4e05 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9ade0d06260e..6f1ae1b72fb2 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 @@ -67,6 +67,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,6 +139,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -152,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 54933c5704f2..4b19c17f81be 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f8773a26c671..f554a1434540 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8172c0a88e2b..bfd4801d89ed 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -350,6 +346,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -362,15 +362,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -415,6 +411,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 02d9b19c928a..fb98a02d41cd 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('BastionHost', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f74b2073382f..3d29ba972437 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a2b6613dcf9a..524ce9963ed5 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -378,7 +374,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +395,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -486,7 +481,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -595,7 +589,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -605,7 +598,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -625,7 +617,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -708,6 +700,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -721,15 +717,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8c30ae41f2a9..91aef515a63d 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -360,7 +356,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -388,7 +383,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. 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 bcd0fc18c8e1..d3c8bb5b56c9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 77747ba102f5..36f575c729d6 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 578eae9a4b6f..6d64b77b2658 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8aba41a2852f..9a0a3f01f48e 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 705ba06e4e53..9af876c67761 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aa23a5fe60e0..6028d18e3ba1 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c859eae67641..701b652850fb 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 26bf23edf74e..298a5b146125 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 5a8966f533b3..2677c323325d 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 170e2d69d2ba..ae7a26d73623 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 c57c3e4f10ed..7824c536c38b 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 493c8889abf9..5ec1c2ebf550 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 74291a9d8777..a7f530f01519 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7f5e343c6675..6b50dc2ca3a6 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f2e27edb2a01..d316fc286583 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 676f7e88ce2d..a2e2e2283ef5 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 9fb888b8e3ca..f4e682232271 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8b43d165e47b..8f50396b3c98 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 085a8ccea9b3..96e8c8e1afe2 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 fdc33132c2c5..01d1e8d6f7ac 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 66b32aff8634..5f6676f88123 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 60c530296b48..d6335f088323 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 91d94b4ede09..67b22afe71e2 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e1d00bd6c303..ad1ad23cfa13 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e1498396012d..2610d6ab5da8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0a3764c3c260..a108ba64a5e2 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c9be839a3be2..74091a35c695 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cc5bb431ba2e..26a8d959bc43 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1dec22ba6573..397958e00c87 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 dd3bad0bf3dd..6d1c659df9a4 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -123,7 +122,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 1f0bc5819363..69d28cc2197f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3f6461696a1c..7586f88e3d94 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 862976da756c..38435c826eb4 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. 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 6badc0e951f2..75d991183f05 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 42e08f3ec11e..96bf840f9f87 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( p2_s_vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -385,7 +380,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,7 +400,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -480,6 +474,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -546,6 +540,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -557,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,8 +594,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -625,7 +619,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -655,7 +648,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -721,8 +714,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> Optional["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -744,7 +737,6 @@ def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -769,7 +761,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. 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 a29cfa304a29..7d61998e6655 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -374,6 +370,10 @@ def list_by_virtual_wan( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4a960ab4c667..c5ab3ed91ced 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a5f7aa8f550e..b6b935e9d8db 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 20053f7844cb..27857a1ef008 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( private_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 152e0476f385..abe4c4ac010a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -520,7 +516,6 @@ def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -572,7 +567,6 @@ def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -594,7 +588,7 @@ def begin_delete_private_endpoint_connection( pe_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -650,32 +644,21 @@ def get_long_running_output(pipeline_response): 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 check_private_link_service_visibility( + def _check_private_link_service_visibility_initial( self, location, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" - """Checks 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.v2019_04_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -691,7 +674,6 @@ def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -700,47 +682,98 @@ def check_private_link_service_visibility( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - def check_private_link_service_visibility_by_resource_group( + def begin_check_private_link_service_visibility( self, location, # type: str - resource_group_name, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" + # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] """Checks the subscription is visible to private link service. :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.v2019_04_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_04_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -757,7 +790,6 @@ def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -766,17 +798,85 @@ def check_private_link_service_visibility_by_resource_group( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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 the subscription is visible to private link service. + + :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.v2019_04_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.v2019_04_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -800,6 +900,10 @@ def list_auto_approved_private_link_services( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -812,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -872,6 +972,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -885,15 +989,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7d18322f7909..9a261e0d5961 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 94595e55c6c5..c1f8b685a131 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3739edf8dbc9..c04d8131f52f 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a5c7d33c491c..f29749e25774 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 24be5dd0fe97..32d25513f662 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2e77aebc0295..6e9441d276d3 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a2aaf40f5656..973a661b9ea8 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fe4d6ef7b006..2610702f8ff3 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d90bb6a3d1c2..66f80e9aa10d 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ff0aae277c6f..7fff06f3d8ef 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b081ad606ea6..498459896dc7 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 37c5dab1eb5e..fcfda5776e70 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 @@ -82,7 +82,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 9f9f62fc1477..1a8a32ab7568 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -493,6 +488,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -506,15 +505,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3306de006758..1e41145ec9af 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0a6f8c94ce33..89e2f1e088a7 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fa59556ffd80..a1a290321d02 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -393,7 +388,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -485,7 +480,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -498,7 +492,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -518,7 +511,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 +615,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -661,6 +653,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -673,15 +669,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -715,8 +707,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -740,7 +732,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -770,7 +761,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 2c06b7e26605..f0b839287371 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list_connections( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -553,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -595,8 +590,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -620,7 +615,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -646,7 +640,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -734,7 +728,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +747,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -815,8 +808,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -840,7 +833,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -870,7 +862,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -938,8 +930,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -963,7 +955,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -993,7 +984,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,8 +1051,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1083,7 +1074,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1108,7 +1098,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1172,8 +1162,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1197,7 +1187,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1223,7 +1212,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1322,7 +1311,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1345,8 +1333,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1368,7 +1356,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1393,7 +1380,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1457,8 +1444,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1481,7 +1468,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1507,7 +1493,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1574,8 +1560,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1599,7 +1585,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1629,7 +1614,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1719,7 +1704,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1742,7 +1726,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1846,7 +1830,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1873,8 +1856,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientConnectionHealthDetailListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -1896,7 +1879,6 @@ def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1921,7 +1903,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. 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 dea659ebd5b8..1124fe903d6e 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fa5a3ae65e15..388cb08b3254 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( tap_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 44f88751b936..0ac3a53f4174 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -629,7 +624,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -670,6 +664,10 @@ def list_usage( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -683,15 +681,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8786491852d9..ec2f01010065 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4358e4b02792..801e5adad7f7 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 75f536d62011..c26d75af2c24 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -464,8 +458,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> Optional["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-04-01" @@ -487,7 +481,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,7 +505,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -589,6 +582,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -601,15 +598,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -655,6 +648,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -666,15 +663,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7e33b715636f..57b94a797379 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 e5597db8c484..70e9bbd3d7b5 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9a9b884b1f4e..34d8998567f6 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 @@ -68,6 +68,10 @@ def list( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2019-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 3e666bf2b32c..f9f0b55a87c2 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 @@ -130,11 +130,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -143,11 +141,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -155,6 +151,6 @@ "call": "resource_group_name, virtual_wan_name" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_application_gateways_operations_async.py index f74a6fcb5acb..ee13c7209c2c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -887,8 +879,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -914,7 +906,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -944,7 +935,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -962,8 +953,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1038,7 +1029,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1136,7 +1125,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1185,7 +1173,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1233,7 +1220,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1267,6 +1253,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1278,15 +1268,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1348,7 +1334,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_application_security_groups_operations_async.py index e771d9a73f7c..03bd1c2d34c1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -352,7 +348,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -379,7 +374,7 @@ async def begin_update_tags( application_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -394,8 +389,8 @@ async def begin_update_tags( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -455,6 +450,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -466,15 +465,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -533,15 +532,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_delegations_operations_async.py index d4244f75452f..9927b3d0acc2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_endpoint_services_operations_async.py index 4baf64662e70..1a5ea2105d69 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_private_endpoint_types_operations_async.py index f641af74991f..63f7fad40840 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_private_endpoint_types_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -62,6 +62,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -146,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 9f97190247ab..4e817a44df62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 7cf6cc3c7a98..5ca27c9c8ce8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_azure_firewalls_operations_async.py index 189e2aea5d81..1a4a950fc5ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_bastion_hosts_operations_async.py index 26a055027e2d..63303771fd62 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_bastion_hosts_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('BastionHost', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( bastion_host_name: str, parameters: "models.BastionHost", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bastion_host_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,7 +360,6 @@ async def _update_tags_initial( 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('BastionHost', pipeline_response) @@ -384,7 +378,7 @@ async def begin_update_tags( bastion_host_name: str, bastion_host_parameters: "models.TagsObject", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Updates bastion host tags. :param resource_group_name: The resource group name of the BastionHost. @@ -399,8 +393,8 @@ async def begin_update_tags( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +454,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +520,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_bgp_service_communities_operations_async.py index 45c06dce018a..7ba4b8f07c1a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_connection_monitors_operations_async.py index 0a4eba396e39..dab4cd581e18 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -387,7 +383,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -438,7 +433,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -459,7 +453,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -474,8 +468,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -544,7 +538,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -565,7 +558,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -580,8 +573,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -651,7 +644,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -661,7 +653,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -680,7 +671,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -695,8 +686,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -762,6 +753,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -775,15 +770,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_ddos_custom_policies_operations_async.py index 49cca9034ae4..e7ac3b8d212a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -350,7 +346,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -377,7 +372,7 @@ async def begin_update_tags( ddos_custom_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -392,8 +387,8 @@ async def begin_update_tags( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py index cda00397dc93..1de8c40f5093 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( ddos_protection_plan_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_default_security_rules_operations_async.py index 62cde4878721..9f538e4a66f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index ca195004aa4e..b64118bf4b50 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index d4f3487579a3..f5b524b41940 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 60840c3ab459..4f28ac1338b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuits_operations_async.py index d4c319d184b7..351b5376d8c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_connections_operations_async.py index 20f5a4163150..322cf685aa7e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index 0cba27d1dee5..a67365e85734 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py index b36b23ba819f..c9fe03ed2075 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_gateways_operations_async.py index eb91700f6cf6..0ac6ade3123a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_links_operations_async.py index 0ce55b6c442f..f397ef008026 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_ports_locations_operations_async.py index 8e4763b2ede7..6ce050a07bd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_ports_operations_async.py index cd6acec52657..a7822b305a3d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( express_route_port_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_service_providers_operations_async.py index f9d826a1f200..95ad1149350b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_firewall_policies_operations_async.py index 7b5226a120a7..1a2516b9c5ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_firewall_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(firewall_policy_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -300,7 +297,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ 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('FirewallPolicy', pipeline_response) @@ -332,7 +327,7 @@ async def begin_create_or_update( firewall_policy_name: str, parameters: "models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": + ) -> AsyncLROPoller["models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -347,8 +342,8 @@ async def begin_create_or_update( 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: FirewallPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.FirewallPolicy + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.FirewallPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -411,6 +406,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -423,15 +422,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -475,6 +470,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py index d26f1b85ce81..ac1d7ad46abe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_group_name: str, parameters: "models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: FirewallPolicyRuleGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.FirewallPolicyRuleGroup + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.FirewallPolicyRuleGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index f5a89e8faed5..540d7fe7dd82 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py index d07ead193b8b..b311b8170622 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index cc11ad0a1f81..2a8a0ca55515 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index a2011b97f193..db17984b61c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 5496fdb46c3b..9907852995ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index b55fe2597917..26fd00ce8e67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 5419b02bfa4b..cb1032451cce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_probes_operations_async.py index 0aaa6370e641..5c8a22d79879 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancers_operations_async.py index 258a35483516..80e639dd1a2e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_local_network_gateways_operations_async.py index b204ccd18b71..46688ec15e16 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_nat_gateways_operations_async.py index 409202ede6fd..597bf40205f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 28fae7d3754a..e75367dc9bf9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index dcfa208bcc91..808e77b2f592 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 5a332e05e59e..9f81665b64f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interfaces_operations_async.py index da0cdb8e3d5c..ee4145848a6b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_management_client_operations_async.py index df49f1064f1b..e069b72e62d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -117,7 +116,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_profiles_operations_async.py index ae1b5fcbbb9b..7e207b7faa07 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_security_groups_operations_async.py index 020df381c038..aa2fa17bc0dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_watchers_operations_async.py index 36838d04ed76..50c16f431a56 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "models.NetworkConfigurationDiagnosticResponse": + ) -> AsyncLROPoller["models.NetworkConfigurationDiagnosticResponse"]: """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. @@ -1847,8 +1819,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_operations_async.py index 142f7fef7579..0cad8ee08044 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index e160905a318e..4e9bce15e807 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, p2_s_vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -304,8 +299,8 @@ async def begin_update_tags( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,7 +370,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,7 +389,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -408,8 +402,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -468,6 +462,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +478,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -533,6 +527,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -544,15 +542,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,8 +580,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -611,7 +605,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -640,7 +633,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -656,8 +649,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -705,8 +698,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> Optional["models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -728,7 +721,6 @@ async def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -752,7 +744,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -766,8 +758,8 @@ async def begin_get_p2_s_vpn_connection_health( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py index 82bc786b0a1c..018781d20a76 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( p2_s_vpn_server_configuration_name: str, p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: P2SVpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.P2SVpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either P2SVpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.P2SVpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list_by_virtual_wan( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_packet_captures_operations_async.py index 3cd17a9f87e9..15829eddbdb6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index 77a270c768cc..a48537dda75d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_private_endpoints_operations_async.py index abfb192211eb..ace2c4686e4b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_private_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_private_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, private_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( private_endpoint_name: str, parameters: "models.PrivateEndpoint", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateEndpoint + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.PrivateEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_private_link_services_operations_async.py index 2e25561a27b1..f4b9e10b8727 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_private_link_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_private_link_services_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, service_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( service_name: str, parameters: "models.PrivateLinkService", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateLinkService, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateLinkService + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.PrivateLinkService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -508,7 +504,6 @@ async def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -559,7 +554,6 @@ async def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -580,7 +574,7 @@ async def begin_delete_private_endpoint_connection( service_name: str, pe_connection_name: str, **kwargs - ) -> None: + ) -> 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. @@ -595,8 +589,8 @@ async def begin_delete_private_endpoint_connection( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -636,31 +630,20 @@ def get_long_running_output(pipeline_response): 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 - async def check_private_link_service_visibility( + async def _check_private_link_service_visibility_initial( self, location: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": - """Checks 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.v2019_06_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + ) -> Optional["models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -676,7 +659,6 @@ async def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -685,46 +667,96 @@ async def check_private_link_service_visibility( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - async def check_private_link_service_visibility_by_resource_group( + async def begin_check_private_link_service_visibility( self, location: str, - resource_group_name: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": + ) -> AsyncLROPoller["models.PrivateLinkServiceVisibility"]: """Checks the subscription is visible to private link service. :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.v2019_06_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -741,7 +773,6 @@ async def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -750,17 +781,84 @@ async def check_private_link_service_visibility_by_resource_group( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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 the subscription is visible to private link service. + + :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.v2019_06_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.v2019_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -783,6 +881,10 @@ def list_auto_approved_private_link_services( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -795,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -854,6 +952,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -867,15 +969,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_public_ip_addresses_operations_async.py index 2ec402d4d452..3de1d8065f45 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_public_ip_prefixes_operations_async.py index 7d0813bd285e..d2355b07ffaa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_resource_navigation_links_operations_async.py index 4cb41338f748..1d3b15247cb4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_filter_rules_operations_async.py index e35c58b389c2..1558a478849c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_filters_operations_async.py index 5314220653a6..e1b997f0dc11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_tables_operations_async.py index 8ee9586fecb5..0ecef4beb230 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_routes_operations_async.py index 19917af2c1d5..10e1e957d621 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_security_rules_operations_async.py index 1f9d5f5db628..4d79fd338039 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_association_links_operations_async.py index 83e6542d49bb..d420e9a1ccd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_endpoint_policies_operations_async.py index e9a79a840380..b39a75dbf30f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index 71f7e4536228..1d22c4cde480 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_tags_operations_async.py index 1c5dff0b2f1d..16a3fcee13ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_service_tags_operations_async.py @@ -77,7 +77,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_subnets_operations_async.py index e9df1385ae8a..d88d58005b58 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -490,7 +485,6 @@ async def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -515,7 +509,7 @@ async def begin_unprepare_network_policies( subnet_name: str, unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -533,8 +527,8 @@ async def begin_unprepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -598,6 +592,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -611,15 +609,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_usages_operations_async.py index 3105e9bb35bf..f6255b0401d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_hubs_operations_async.py index c080b378a9c3..dcbd5a5ede2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index e0d945a0edb3..63573371925f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -330,8 +326,8 @@ async def _update_tags_initial( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> Optional["models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -400,8 +395,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,7 +470,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -488,7 +482,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -507,7 +500,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -525,8 +518,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -610,7 +603,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -648,6 +640,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -660,15 +656,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -701,8 +693,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -726,7 +718,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -755,7 +746,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -774,8 +765,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 67b2cbfb0a0c..d0cd7654876e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -326,8 +322,8 @@ async def _update_tags_initial( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,6 +524,10 @@ def list_connections( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -542,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -583,8 +578,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -608,7 +603,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -633,7 +627,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -649,8 +643,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -720,7 +714,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -739,7 +732,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -753,8 +746,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -799,8 +792,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -824,7 +817,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -853,7 +845,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -870,8 +862,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -920,8 +912,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -945,7 +937,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -974,7 +965,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -991,8 +982,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1040,8 +1031,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1063,7 +1054,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1101,8 +1091,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1150,8 +1140,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1175,7 +1165,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1200,7 +1189,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1215,8 +1204,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1298,7 +1287,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1320,8 +1308,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1343,7 +1331,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1367,7 +1354,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1381,8 +1368,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1430,8 +1417,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1454,7 +1441,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1479,7 +1465,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1495,8 +1481,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1545,8 +1531,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1570,7 +1556,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1599,7 +1584,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1616,8 +1601,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1688,7 +1673,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1710,7 +1694,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1725,8 +1709,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1797,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1839,8 +1822,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientConnectionHealthDetailListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1862,7 +1845,6 @@ async def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1886,7 +1868,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1900,8 +1882,8 @@ async def begin_get_vpnclient_connection_health( 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: VpnClientConnectionHealthDetailListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnClientConnectionHealthDetailListResult + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnClientConnectionHealthDetailListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 9c7c2ef17e05..e81d40a3e438 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_taps_operations_async.py index 353718bdd20f..d576f328bee7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( tap_name: str, tap_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_networks_operations_async.py index 953202a4e112..9d20fd629188 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -615,7 +610,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -655,6 +649,10 @@ def list_usage( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -668,15 +666,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_wans_operations_async.py index b672ebef82ad..a169ded3e5d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_connections_operations_async.py index 27b2e93c2e2b..b4c0d035f412 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_gateways_operations_async.py index 0af04dab8c72..65af8d64b25f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -452,8 +446,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> Optional["models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -475,7 +469,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -499,7 +492,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> "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. @@ -512,8 +505,8 @@ async def begin_reset( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -575,6 +568,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -587,15 +584,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -640,6 +633,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -651,15 +648,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_link_connections_operations_async.py index fb40ce3f499d..901c82ffa3be 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -68,6 +68,10 @@ def list_by_vpn_connection( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_site_link_connections_operations_async.py index bdc1678d78d9..341e59a813d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_site_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_site_link_connections_operations_async.py @@ -87,7 +87,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_site_links_operations_async.py index 1d926c77f371..20f9564781a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_site_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list_by_vpn_site( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 21aa81a9b20f..73279eb1f8e7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_sites_operations_async.py index 8e14d6c9da48..9a373e232bea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_06_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index 9b352f52a840..4f91d263e0e6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] 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 339b1111aac6..fb552e4dfba7 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -907,8 +899,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -934,7 +926,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -965,7 +956,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,7 +1051,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1160,7 +1149,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1210,7 +1198,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1259,7 +1246,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1294,6 +1280,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1305,15 +1295,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1376,7 +1362,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8dad40c8216c..161617600df6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -362,7 +358,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -390,7 +385,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -467,6 +462,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -478,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -546,15 +545,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2e700d685fb9..ff2888a8f3de 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cdf1f91b7f3d..ca82be51975a 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ee6ee73e1b1a..3e6924e25a65 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 @@ -67,6 +67,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,6 +139,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -152,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a4ab8a685470..0b252613e96e 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bfb3491eed9e..a4e6fb02bdf7 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8b0c8b266f2e..50009d749d4f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 230ad3ee5e95..1485843c0802 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('BastionHost', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bastion_host_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -375,7 +370,6 @@ def _update_tags_initial( 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('BastionHost', pipeline_response) @@ -395,7 +389,7 @@ def begin_update_tags( bastion_host_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Updates bastion host tags. :param resource_group_name: The resource group name of the BastionHost. @@ -472,6 +466,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +533,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0117e6c68cdf..433cfa424aab 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7de879a4cfe3..9b5fc55f4b62 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -397,7 +393,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -449,7 +444,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -471,7 +465,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -557,7 +551,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -579,7 +572,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -666,7 +659,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +668,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -696,7 +687,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -779,6 +770,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -792,15 +787,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6abd14759d2a..4b3dd6165c32 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -360,7 +356,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -388,7 +383,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. 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 85f25512f3db..37e94acfbce5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c46e35fd900c..10e3e985832e 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 69199b4223fb..a0dfd0c589e0 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 68cfeb8beae7..5862603c0b30 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8b0609e4d59a..474d96e55169 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9cc8ef6965b3..1f10fea8b8fb 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7658f7438e17..eeb4b12a9e42 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 6ef9759e3377..99873c1167be 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 6962ad2c32ea..dc54a490a37c 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 d83331496859..d557c73a961a 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 fe9f024a2370..1229849c4ca8 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fe4270c9e9d0..5f2ed54ba0cd 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 1a784236eb8a..b6a3819bbe7d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 89d71c7d5d62..a4abb9be5fea 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a440b08021e8..42e7b3a241a6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(firewall_policy_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -309,7 +306,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ 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('FirewallPolicy', pipeline_response) @@ -342,7 +337,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -422,6 +417,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -434,15 +433,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -487,6 +482,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e2a121234001..b42dff5d348f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ef98d3349796..aaea39d2123f 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 481003e9df96..be924e63bc45 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 12f72c7eb248..6b211dd364cc 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c76398931a29..c9fff8673883 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c427a18bca13..c7baa98b8135 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c7843df5cfb6..23611c4f034e 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ff65b1c05427..537409555e9e 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 453cbc7b8805..437fe4a2e2eb 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d56e03170463..eb1c5779b42b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 972103cb517d..0ab7706f95bf 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5a0bc4361342..e00b77408b6c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 65fc5b34dad0..55effe13f6af 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 0e40f38f3224..7a0f10415e85 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 65b02e7242f7..b29ce42847e6 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f8907c98700f..121b727fe61c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3fe04c48eefd..041b2e0b1f50 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -123,7 +122,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 a4dc6917802e..bd5737cb02f2 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2a819137fc50..327084ec3dec 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c7bf66c08162..856b86ee80d2 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkConfigurationDiagnosticResponse"] """Get network configuration diagnostic. :param resource_group_name: The name of the resource group. 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 87c84f488a8c..0f46493a4ebc 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a194f717175e..a800c1e67b01 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( p2_s_vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -385,7 +380,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,7 +400,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -480,6 +474,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -546,6 +540,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -557,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,8 +594,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -625,7 +619,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -655,7 +648,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -721,8 +714,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> Optional["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -744,7 +737,6 @@ def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -769,7 +761,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. 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 e81359495483..93722effbaea 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -374,6 +370,10 @@ def list_by_virtual_wan( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5676855363ee..acfc9e8fa730 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6211b4fa7d1d..e8bca9184537 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 901543836eb4..3b467a252c75 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( private_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ebb92b0ad0a3..378fd1b83e49 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -520,7 +516,6 @@ def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -572,7 +567,6 @@ def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -594,7 +588,7 @@ def begin_delete_private_endpoint_connection( pe_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -650,32 +644,21 @@ def get_long_running_output(pipeline_response): 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 check_private_link_service_visibility( + def _check_private_link_service_visibility_initial( self, location, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" - """Checks 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.v2019_06_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -691,7 +674,6 @@ def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -700,47 +682,98 @@ def check_private_link_service_visibility( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - def check_private_link_service_visibility_by_resource_group( + def begin_check_private_link_service_visibility( self, location, # type: str - resource_group_name, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" + # type: (...) -> LROPoller["models.PrivateLinkServiceVisibility"] """Checks the subscription is visible to private link service. :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.v2019_06_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_06_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -757,7 +790,6 @@ def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -766,17 +798,85 @@ def check_private_link_service_visibility_by_resource_group( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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 the subscription is visible to private link service. + + :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.v2019_06_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.v2019_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -800,6 +900,10 @@ def list_auto_approved_private_link_services( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -812,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -872,6 +972,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -885,15 +989,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2f885ade421d..51f4f654fb08 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2017-03-30" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 eb519b007ded..a3cf2c62f900 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c0ac8eb06756..1678926b3afc 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 780fc3b80b6d..e64c8cdf6a81 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ea3b8bf05ffb..bdcb35d98395 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e6deb9f077d1..714fa433c06e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9ba7351f4b3f..d38c7dd29206 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6943fcbcb033..bbf942f923f4 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 99f22e1f1c7f..d9b6e1882465 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 434bb4ce0852..7b7ecd794187 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 40d21e460d32..40bbbfd7a77d 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b0c93ee20a97..1f38508d14b6 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 @@ -82,7 +82,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 34fbc77b7fac..f63c58625ab6 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -502,7 +497,6 @@ def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -528,7 +522,7 @@ def begin_unprepare_network_policies( unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -612,6 +606,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -625,15 +623,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7975d8835fc5..9bc6c4f8ec9d 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 37b6a8b46732..0bec4811c738 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6712d6882e43..77dba1bbeec3 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -340,8 +336,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -487,7 +482,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -500,7 +494,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -520,7 +513,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -624,7 +617,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,6 +655,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -675,15 +671,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -717,8 +709,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -742,7 +734,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -772,7 +763,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 0db87d746556..3ace0fc4c8d6 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,6 +537,10 @@ def list_connections( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -555,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -597,8 +592,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -622,7 +617,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -648,7 +642,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -736,7 +730,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -756,7 +749,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -817,8 +810,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -842,7 +835,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -940,8 +932,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -965,7 +957,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -995,7 +986,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1062,8 +1053,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1085,7 +1076,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1174,8 +1164,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1199,7 +1189,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1225,7 +1214,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1324,7 +1313,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1347,8 +1335,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1370,7 +1358,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1395,7 +1382,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1459,8 +1446,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1483,7 +1470,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1509,7 +1495,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1576,8 +1562,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1601,7 +1587,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1631,7 +1616,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1721,7 +1706,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1744,7 +1728,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1848,7 +1832,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1875,8 +1858,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientConnectionHealthDetailListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -1898,7 +1881,6 @@ def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1923,7 +1905,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. 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 331c05e943e1..a217d05b8f74 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 982608545e97..17ce22ecd4e8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( tap_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b7031fb1a22b..9e8f787bb8c3 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -629,7 +624,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -670,6 +664,10 @@ def list_usage( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -683,15 +681,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ec8607002257..ad046ec9b132 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 51f2cddd2972..f7cdfaa3a775 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 813479e3402d..748a73e26f24 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -464,8 +458,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> Optional["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" @@ -487,7 +481,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,7 +505,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -589,6 +582,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -601,15 +598,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -655,6 +648,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -666,15 +663,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 106bb565bbcf..40d8eeb2a2b2 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 @@ -73,6 +73,10 @@ def list_by_vpn_connection( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -87,15 +91,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 71c75373630f..1b3961abcb9f 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 @@ -92,7 +92,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 c0b7ce272a20..e262c17cae04 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list_by_vpn_site( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9fc5b9134825..12ea6e5582a1 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 ba3206c96007..d088396c895f 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c76fd31428ca..f5838aca642a 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 @@ -68,6 +68,10 @@ def list( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2019-06-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 47a6119b6af9..ef8353c22675 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 @@ -132,11 +132,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -145,11 +143,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -157,6 +153,6 @@ "call": "resource_group_name, virtual_wan_name" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.mgmt.core.exceptions import ARMErrorFormat" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_application_gateways_operations_async.py index 5c07142db335..53e03c685b0a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -887,8 +879,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -914,7 +906,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -944,7 +935,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -962,8 +953,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1038,7 +1029,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1136,7 +1125,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1185,7 +1173,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1233,7 +1220,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1267,6 +1253,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1278,15 +1268,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1348,7 +1334,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_application_security_groups_operations_async.py index 0d3cdb7e59f4..d71aa57424bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -352,7 +348,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -379,7 +374,7 @@ async def begin_update_tags( application_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -394,8 +389,8 @@ async def begin_update_tags( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -455,6 +450,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -466,15 +465,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -533,15 +532,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_delegations_operations_async.py index 86ed38d737aa..f1db42310b51 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_endpoint_services_operations_async.py index 58b87d582a78..1c41bea782bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_private_endpoint_types_operations_async.py index 8d613d0a74d9..a4bfcee8d536 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_private_endpoint_types_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -62,6 +62,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -146,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index bb23f1f6fc56..3655a88a75f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index d79cc3f984d7..940de0274a73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_azure_firewalls_operations_async.py index 8881ed342cd1..99c8fb384855 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_bastion_hosts_operations_async.py index d3e2c49fb9dc..aa204e2a88b9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_bastion_hosts_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('BastionHost', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( bastion_host_name: str, parameters: "models.BastionHost", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_bgp_service_communities_operations_async.py index 50fd6a6a227e..77f2d9eac942 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_connection_monitors_operations_async.py index d0b5d6109180..d54bf071e7c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -387,7 +383,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -438,7 +433,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -459,7 +453,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -474,8 +468,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -544,7 +538,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -565,7 +558,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -580,8 +573,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -651,7 +644,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -661,7 +653,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -680,7 +671,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -695,8 +686,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -762,6 +753,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -775,15 +770,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_ddos_custom_policies_operations_async.py index 41fba80201e9..17bb8cc24aed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -350,7 +346,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -377,7 +372,7 @@ async def begin_update_tags( ddos_custom_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -392,8 +387,8 @@ async def begin_update_tags( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_ddos_protection_plans_operations_async.py index ad6e2eb48c05..fa2692c6857f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( ddos_protection_plan_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_default_security_rules_operations_async.py index 79d0ba5f2c1a..6360dd948fde 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 3e562ca8c2da..87a8140272ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index 161fb39df07b..167a9cd9979b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 6d6b21e7efed..6e1071e8e5ac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuits_operations_async.py index c1a44a4a6e07..8aa2c8cf82e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_connections_operations_async.py index 3e7f9eb06221..c7c72ef0e9d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index 85919f2025e2..375f294d4f0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 426c056b5768..0a87e5b24087 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_gateways_operations_async.py index f07e61bffa86..d8f1d6bf1ef6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_links_operations_async.py index 8c3280634b77..bfffb6ce83b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_ports_locations_operations_async.py index eef483981604..2b4f47c28527 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_ports_operations_async.py index 7ad6d8b88e8d..7255c50a4e65 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( express_route_port_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_service_providers_operations_async.py index 84440d1d6ed9..797951a7820a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_firewall_policies_operations_async.py index 01b1ac05c8d7..bc27100a3ad3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_firewall_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(firewall_policy_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -300,7 +297,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ 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('FirewallPolicy', pipeline_response) @@ -332,7 +327,7 @@ async def begin_create_or_update( firewall_policy_name: str, parameters: "models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": + ) -> AsyncLROPoller["models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -347,8 +342,8 @@ async def begin_create_or_update( 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: FirewallPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.FirewallPolicy + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.FirewallPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -411,6 +406,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -423,15 +422,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -475,6 +470,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py index 97e7dc3ab350..03d4b99bf0e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_group_name: str, parameters: "models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: FirewallPolicyRuleGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.FirewallPolicyRuleGroup + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.FirewallPolicyRuleGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 50d3dcfce840..7cc6366fa59b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 57557f26278b..87a4abb0d3ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 9e9fb5e47864..55630b816d58 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index c3d2a5726e79..dfb2b7c4421f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index d1e0cc06e7f0..c665ccc115ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index d770e815139d..4bb1098fd57f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index cf3589425993..3f05b70112b7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_probes_operations_async.py index ee8f72de9620..21f319e73082 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancers_operations_async.py index a00f7e609493..51cca3f6b650 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_local_network_gateways_operations_async.py index a597d0843d8d..26744e0c71ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_nat_gateways_operations_async.py index d21c1b7c9f92..a65c342d5308 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index d03b2bad865d..628ad3d64c0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index d12f8aa84e22..6d8734198181 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 451d694334d6..bf0cd7700d3f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interfaces_operations_async.py index 09c309864154..3f6a6ccb2296 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_management_client_operations_async.py index bb566011f236..0e2a86243221 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_management_client_operations_async.py @@ -60,7 +60,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -117,7 +116,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_profiles_operations_async.py index fd2455d091bd..5352d4860094 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_security_groups_operations_async.py index 7a81e036ea1d..533108f35fb3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_watchers_operations_async.py index f25c7110e7f5..719c5ffdc3aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "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 @@ -1851,8 +1823,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_operations_async.py index 4a547ff53fc8..0318c069e2b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index 41b5ef77e824..bc700003f17f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, p2_s_vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -304,8 +299,8 @@ async def begin_update_tags( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -375,7 +370,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -395,7 +389,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -408,8 +402,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -468,6 +462,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +478,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -533,6 +527,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -544,15 +542,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -586,8 +580,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -611,7 +605,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -640,7 +633,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -656,8 +649,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -705,8 +698,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> Optional["models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -728,7 +721,6 @@ async def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -752,7 +744,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -766,8 +758,8 @@ async def begin_get_p2_s_vpn_connection_health( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py index 5006cb18d6ea..fbb1c2af6dee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_p2_svpn_server_configurations_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( p2_s_vpn_server_configuration_name: str, p2_s_vpn_server_configuration_parameters: "models.P2SVpnServerConfiguration", **kwargs - ) -> "models.P2SVpnServerConfiguration": + ) -> AsyncLROPoller["models.P2SVpnServerConfiguration"]: """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: P2SVpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.P2SVpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either P2SVpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.P2SVpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_wan_name: str, p2_s_vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list_by_virtual_wan( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_packet_captures_operations_async.py index 5418ace9aca2..0ea7b7c32e06 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index f8e85236c874..3963cd07ef3a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_private_endpoints_operations_async.py index bfee1583b825..220878256ad6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_private_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_private_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, private_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( private_endpoint_name: str, parameters: "models.PrivateEndpoint", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateEndpoint + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.PrivateEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_private_link_services_operations_async.py index ab36c729e896..160a069c340e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_private_link_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_private_link_services_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, service_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( service_name: str, parameters: "models.PrivateLinkService", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateLinkService, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateLinkService + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.PrivateLinkService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -508,7 +504,6 @@ async def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -559,7 +554,6 @@ async def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -580,7 +574,7 @@ async def begin_delete_private_endpoint_connection( service_name: str, pe_connection_name: str, **kwargs - ) -> None: + ) -> 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. @@ -595,8 +589,8 @@ async def begin_delete_private_endpoint_connection( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -636,31 +630,20 @@ def get_long_running_output(pipeline_response): 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 - async def check_private_link_service_visibility( + async def _check_private_link_service_visibility_initial( self, location: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "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.v2019_07_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + ) -> Optional["models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -676,7 +659,6 @@ async def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -685,47 +667,96 @@ async def check_private_link_service_visibility( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - async def check_private_link_service_visibility_by_resource_group( + async def begin_check_private_link_service_visibility( self, location: str, - resource_group_name: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": - """Checks whether the subscription is visible to private link service in the specified resource - group. + ) -> 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 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.v2019_07_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -742,7 +773,6 @@ async def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -751,17 +781,85 @@ async def check_private_link_service_visibility_by_resource_group( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_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.v2019_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -784,6 +882,10 @@ def list_auto_approved_private_link_services( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -796,15 +898,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -855,6 +953,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -868,15 +970,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_public_ip_addresses_operations_async.py index a83b3adcc915..3aefd7d350d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_public_ip_prefixes_operations_async.py index ab5e9d322341..e453f5e52c55 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_resource_navigation_links_operations_async.py index 3ac998555441..2ca98a254549 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_filter_rules_operations_async.py index 63905b6a554c..0c82feaaa1b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_filters_operations_async.py index 9f8873dfe0c2..147134013ed3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_tables_operations_async.py index 075c9dcf33b3..201cbedda4c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_routes_operations_async.py index 66e175971fd5..199e1c50e617 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_security_rules_operations_async.py index 4bcfb41c1062..8da7ab654634 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_association_links_operations_async.py index 982c9fa51345..5cff0625f3dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_endpoint_policies_operations_async.py index a555c9b83a43..a65fa849b2fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index 45af27514463..396aff4269c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_tags_operations_async.py index 83354a5c7fe6..d1654a2857c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_service_tags_operations_async.py @@ -77,7 +77,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_subnets_operations_async.py index ccca83d1a6d0..09076483cf36 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -490,7 +485,6 @@ async def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -515,7 +509,7 @@ async def begin_unprepare_network_policies( subnet_name: str, unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -533,8 +527,8 @@ async def begin_unprepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -598,6 +592,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -611,15 +609,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_usages_operations_async.py index 46f6771437f3..b0700014fdca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_hubs_operations_async.py index fa035548509b..6b0fa094d318 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index a5829812a33f..5c6788010c9d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -330,8 +326,8 @@ async def _update_tags_initial( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> Optional["models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -400,8 +395,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,7 +470,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -488,7 +482,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -507,7 +500,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -525,8 +518,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -610,7 +603,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -648,6 +640,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -660,15 +656,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -701,8 +693,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -726,7 +718,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -755,7 +746,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -774,8 +765,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -824,8 +815,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -849,7 +840,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -882,7 +872,7 @@ async def begin_start_packet_capture( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> 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. @@ -899,8 +889,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -949,8 +939,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -974,7 +964,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1004,7 +993,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> 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. @@ -1021,8 +1010,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_gateways_operations_async.py index e97f81570a30..dbc234fef7f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -326,8 +322,8 @@ async def _update_tags_initial( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,6 +524,10 @@ def list_connections( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -542,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -583,8 +578,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -608,7 +603,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -633,7 +627,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -649,8 +643,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -720,7 +714,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -739,7 +732,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -753,8 +746,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -799,8 +792,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -824,7 +817,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -853,7 +845,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -870,8 +862,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -920,8 +912,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -945,7 +937,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -974,7 +965,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -991,8 +982,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1040,8 +1031,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1063,7 +1054,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1101,8 +1091,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1150,8 +1140,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1175,7 +1165,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1200,7 +1189,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1215,8 +1204,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1298,7 +1287,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1320,8 +1308,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1343,7 +1331,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1367,7 +1354,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1381,8 +1368,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1430,8 +1417,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1454,7 +1441,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1479,7 +1465,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1495,8 +1481,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1545,8 +1531,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1570,7 +1556,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1599,7 +1584,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1616,8 +1601,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1688,7 +1673,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1710,7 +1694,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1725,8 +1709,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1797,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1840,8 +1823,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1865,7 +1848,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1898,7 +1880,7 @@ async def begin_start_packet_capture( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -1914,8 +1896,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1964,8 +1946,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1989,7 +1971,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2019,7 +2000,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2035,8 +2016,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -2084,8 +2065,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientConnectionHealthDetailListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -2107,7 +2088,6 @@ async def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -2131,7 +2111,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -2145,8 +2125,8 @@ async def begin_get_vpnclient_connection_health( 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: VpnClientConnectionHealthDetailListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnClientConnectionHealthDetailListResult + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnClientConnectionHealthDetailListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 7d6822a0936b..20421279b40e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_taps_operations_async.py index 72484418a4f5..caf4e7d370fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( tap_name: str, tap_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_networks_operations_async.py index 446c596d250d..235350154863 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -615,7 +610,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -655,6 +649,10 @@ def list_usage( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -668,15 +666,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_router_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_router_peerings_operations_async.py index 29c6388cb115..05293b610424 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_router_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_router_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -93,7 +92,7 @@ async def begin_delete( virtual_router_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -192,7 +191,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -258,7 +256,6 @@ async def update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -313,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -327,7 +323,6 @@ async def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -347,7 +342,7 @@ async def begin_create_or_update( peering_name: str, parameters: "models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": + ) -> AsyncLROPoller["models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -365,8 +360,8 @@ async def begin_create_or_update( 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: VirtualRouterPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouterPeering + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualRouterPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -433,6 +428,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -446,15 +445,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_routers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_routers_operations_async.py index a321daf66a84..e9b4d34a913d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_routers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_routers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -249,7 +247,6 @@ async def update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -302,7 +299,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -316,7 +312,6 @@ async def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -335,7 +330,7 @@ async def begin_create_or_update( virtual_router_name: str, parameters: "models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": + ) -> AsyncLROPoller["models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -350,8 +345,8 @@ async def begin_create_or_update( 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: VirtualRouter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualRouter + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualRouter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -414,6 +409,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +425,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -479,6 +474,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -490,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_wans_operations_async.py index cd0b915fa627..b9f8f3694995 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_connections_operations_async.py index 37c767f07bd2..aa18dc7015cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -189,8 +186,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -263,7 +260,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -284,7 +280,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -299,8 +295,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,6 +359,10 @@ def list_by_vpn_gateway( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_gateways_operations_async.py index 0da9d27a9f9f..97446835cab5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -269,7 +265,6 @@ async def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -288,7 +283,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -394,7 +388,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -407,8 +401,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -452,8 +446,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> Optional["models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -475,7 +469,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -499,7 +492,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> "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. @@ -512,8 +505,8 @@ async def begin_reset( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -575,6 +568,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -587,15 +584,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -640,6 +633,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -651,15 +648,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_link_connections_operations_async.py index 40b35f196328..43ab493b9844 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -68,6 +68,10 @@ def list_by_vpn_connection( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_site_link_connections_operations_async.py index 40d528891be1..897e919e37b4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_site_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_site_link_connections_operations_async.py @@ -87,7 +87,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_site_links_operations_async.py index f67548d5f1b4..a7aa5f701277 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_site_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,6 +124,10 @@ def list_by_vpn_site( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -138,15 +141,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 941fa32c1245..8a51f7eb64d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -97,7 +96,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -113,8 +112,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_sites_operations_async.py index b41d97630c52..a7ebcf372919 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -131,7 +130,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -145,7 +143,6 @@ async def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -164,7 +161,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -179,8 +176,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -254,7 +251,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -302,8 +297,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_07_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +368,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -531,6 +525,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -542,15 +540,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index 4d66711849f0..d163ecbf469c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] 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 2533749e3692..dc3663ba4772 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -907,8 +899,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -934,7 +926,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -965,7 +956,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,7 +1051,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1160,7 +1149,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1210,7 +1198,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1259,7 +1246,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1294,6 +1280,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1305,15 +1295,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1376,7 +1362,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 85c9f87cbbcf..9db23d306ff1 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -362,7 +358,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -390,7 +385,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -467,6 +462,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -478,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -546,15 +545,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 940c62ba2ade..2ff02aa4e062 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f6258bb63a44..1d17dc9c3e6a 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aab9034f4805..6a3fa461bd61 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 @@ -67,6 +67,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,6 +139,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -152,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 838f533d9be1..91eec0677556 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 00bc435eb03a..2bc9fdeff04b 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 89e207ec43b0..7c8533eced22 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f32082c1fde4..edd79dc6a252 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('BastionHost', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 84b7bcfff3f0..42ee89275d76 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5a888051a7e4..4bff9be51d9a 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -397,7 +393,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -449,7 +444,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -471,7 +465,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -557,7 +551,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -579,7 +572,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -666,7 +659,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +668,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -696,7 +687,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -779,6 +770,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -792,15 +787,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8e8eee842290..7ab6ddee3ff8 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -360,7 +356,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -388,7 +383,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. 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 f8528ba3568a..31bb4ba94b74 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 66cc2366999a..48b0e2ce19e8 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 87987bc5e3cc..f7519a10bab5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ea30e47daa33..187ddeb0f346 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ebc23e0e06fb..f0eed9599c2e 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dcde709af70b..a03b1e45b451 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5193a90d942a..b3dfddeaeb65 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 cf759ec5c6be..5ea95692fb0a 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 36216d874d6e..6a5c7b57cfb2 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 06d4020f0d3b..8b2e7fa00b03 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 9c1814d89565..00f97382b811 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a07ad17c4e62..c337ce42d413 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 741bfd687b05..a9d4571a2877 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 55edd39d2a77..ccb54b888944 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 001e8d3917ed..e1b292c1afeb 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(firewall_policy_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -309,7 +306,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ 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('FirewallPolicy', pipeline_response) @@ -342,7 +337,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -422,6 +417,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -434,15 +433,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -487,6 +482,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f0d8e1787f40..ddb4b40c17b5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bbec33a11792..88758efa246a 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d2eb4c06c967..e2637eccb905 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 0ea8a310815a..0f8cd1a4fb02 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 61d1f7611704..6e20850a71f5 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 195591764329..6c4bf03be22d 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 fb18e6b4dc79..b4e96c32f0e4 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1ab02fae0d7d..eab4093a31a6 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 882bd2ba87e1..bf67948f1b8f 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 209b90355b40..ac5c250a8709 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 21350c56dcb9..2cbdbaee74eb 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 80e6c3748331..65a317223234 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d70ecedac2c3..65fc2ce726cb 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 46571a1bcdbf..8d5a49db050f 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 61f24d684e39..3c297072ddd0 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e2a4709faf6c..c05fb6c9caf9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 fede7bc27445..fa571dcd32b1 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 @@ -65,7 +65,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -123,7 +122,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 890bf9e7e011..f26c76f5e5f6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f9a39b391dd5..e9972a36482f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 591c16fe5060..fcf5c03324d6 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 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 2c16b4a47a12..15e5145fbd14 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 42542682792d..4b8343e626f7 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('P2SVpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('P2SVpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( p2_s_vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -385,7 +380,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -406,7 +400,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -480,6 +474,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -546,6 +540,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -557,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -600,8 +594,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -625,7 +619,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -655,7 +648,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -721,8 +714,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> Optional["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -744,7 +737,6 @@ def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -769,7 +761,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. 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 ad7e868b313e..94cd4b5023e5 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_server_configuration_parameters, 'P2SVpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('P2SVpnServerConfiguration', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( p2_s_vpn_server_configuration_parameters, # type: "models.P2SVpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnServerConfiguration"] """Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( p2_s_vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a P2SVpnServerConfiguration. :param resource_group_name: The resource group name of the P2SVpnServerConfiguration. @@ -374,6 +370,10 @@ def list_by_virtual_wan( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_virtual_wan.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6795580286e5..be8ba3464512 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 15cccc2dac80..7828de29bbff 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3c503fa7179b..323ad73b6db8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( private_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5e4e7fcb356a..e584a2be9543 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -520,7 +516,6 @@ def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -572,7 +567,6 @@ def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -594,7 +588,7 @@ def begin_delete_private_endpoint_connection( pe_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -650,32 +644,21 @@ def get_long_running_output(pipeline_response): 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 check_private_link_service_visibility( + def _check_private_link_service_visibility_initial( self, location, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "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.v2019_07_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -691,7 +674,6 @@ def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -700,48 +682,98 @@ def check_private_link_service_visibility( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - def check_private_link_service_visibility_by_resource_group( + def begin_check_private_link_service_visibility( self, location, # type: str - resource_group_name, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" - """Checks whether the subscription is visible to private link service in the specified resource - group. + # 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 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.v2019_07_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_07_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -758,7 +790,6 @@ def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -767,17 +798,86 @@ def check_private_link_service_visibility_by_resource_group( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_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.v2019_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -801,6 +901,10 @@ def list_auto_approved_private_link_services( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -813,15 +917,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -873,6 +973,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -886,15 +990,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9e6e11e04679..bafa0ae8b53b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 0ae6948420f7..5a6498253a3a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c32464aca394..c94584fc0518 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 34dff2b4f814..de528ce41188 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bc63085081de..ed7e1887dd53 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d1565edcf025..8523c28059e5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5ff76a9b7beb..df24b6e0fd60 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b1945d2363ed..3bcf0226d56f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ab1d7096fd9b..72d763c1daab 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 00fc02b33b77..3a612dca16d3 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 de813840fd74..cbac8d42d147 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7941755da32f..2dacb9404b86 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 @@ -82,7 +82,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 57dad714bdc6..3b3a453f7ed0 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -502,7 +497,6 @@ def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -528,7 +522,7 @@ def begin_unprepare_network_policies( unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -612,6 +606,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -625,15 +623,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e614f9c4498c..2fe7d398419c 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 59a234a167f6..db8e4662ee94 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualHub', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualHub', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7fe235880b3a..9dd5bf9409d9 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -340,8 +336,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -487,7 +482,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -500,7 +494,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -520,7 +513,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -624,7 +617,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,6 +655,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -675,15 +671,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -717,8 +709,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -742,7 +734,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -772,7 +763,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -842,8 +833,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -867,7 +858,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -901,7 +891,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -969,8 +959,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -994,7 +984,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1025,7 +1014,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 073d3301af10..a78908ce6916 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,6 +537,10 @@ def list_connections( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -555,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -597,8 +592,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -622,7 +617,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -648,7 +642,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -736,7 +730,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -756,7 +749,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -817,8 +810,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -842,7 +835,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -940,8 +932,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -965,7 +957,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -995,7 +986,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1062,8 +1053,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1085,7 +1076,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1174,8 +1164,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1199,7 +1189,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1225,7 +1214,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1324,7 +1313,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1347,8 +1335,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1370,7 +1358,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1395,7 +1382,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1459,8 +1446,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1483,7 +1470,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1509,7 +1495,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1576,8 +1562,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1601,7 +1587,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1631,7 +1616,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1721,7 +1706,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1744,7 +1728,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1848,7 +1832,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1876,8 +1859,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -1901,7 +1884,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1935,7 +1917,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2002,8 +1984,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -2027,7 +2009,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2058,7 +2039,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2124,8 +2105,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientConnectionHealthDetailListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -2147,7 +2128,6 @@ def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2172,7 +2152,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. 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 53a1c05232d5..fd5ceec69a6f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e7f779be44a9..e6498dd09d0d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( tap_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 97262d964cf7..f68049230b28 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -629,7 +624,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -670,6 +664,10 @@ def list_usage( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -683,15 +681,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5e6bc7dc77b4..5db9612b30a9 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +98,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -199,7 +198,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -266,7 +264,6 @@ def update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -322,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -336,7 +332,6 @@ def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -357,7 +352,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -444,6 +439,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -457,15 +456,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3105385faebc..5675d86f8a8c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -257,7 +255,6 @@ def update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -311,7 +308,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -325,7 +321,6 @@ def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -345,7 +340,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -425,6 +420,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -437,15 +436,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -491,6 +486,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -502,15 +501,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 030b91452c00..2e86e324b9e2 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VirtualWAN', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VirtualWAN', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a74fdce913e2..73e77c7d4fe7 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VpnConnection', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -271,7 +268,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -293,7 +289,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -373,6 +369,10 @@ def list_by_vpn_gateway( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a0bd3e01adf8..bc3803414628 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnGateway', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -277,7 +273,6 @@ def _update_tags_initial( 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('VpnGateway', pipeline_response) @@ -297,7 +292,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -405,7 +399,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -464,8 +458,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> Optional["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-07-01" @@ -487,7 +481,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -512,7 +505,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -589,6 +582,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -601,15 +598,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -655,6 +648,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -666,15 +663,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 35c392ac4e51..83b683cc5fd0 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 @@ -73,6 +73,10 @@ def list_by_vpn_connection( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -87,15 +91,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a2244439990e..2b28b68d9fd4 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 @@ -92,7 +92,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_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 76b958718091..d2aa4ad29407 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,6 +130,10 @@ def list_by_vpn_site( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -144,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8d43a4ac7b71..f78169e37697 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -103,7 +102,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 3dddcedab3ba..17d5bfb5e70f 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -137,7 +136,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ def _create_or_update_initial( 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('VpnSite', pipeline_response) @@ -171,7 +168,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -262,7 +259,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_initial( 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('VpnSite', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -383,7 +378,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -544,6 +538,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -555,15 +553,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b71e8abdca2e..1363c0e72139 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 @@ -68,6 +68,10 @@ def list( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2019-07-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 74d1a4ed5f59..79fad3526533 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 @@ -134,11 +134,9 @@ "operation_mixins": { "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -147,11 +145,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -160,31 +156,27 @@ }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", "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" }, "async": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", - "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 \"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", "coroutine": true }, "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" }, - "generatevirtualwanvpnserverconfigurationvpnprofile" : { + "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "operation_name": "begin_generatevirtualwanvpnserverconfigurationvpnprofile", "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" }, "async": { - "operation_name": "generatevirtualwanvpnserverconfigurationvpnprofile", - "signature": "async def generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e \"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", "coroutine": true }, - "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: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\"\"\"", + "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:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~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" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.arm_polling import ARMPolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"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\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"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\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}" } \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_application_gateways_operations_async.py index 9ec99033f6d6..0aeb3f6b2d0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( application_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -594,7 +589,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -613,7 +607,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -626,8 +620,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -693,7 +687,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -712,7 +705,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -725,8 +718,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -771,8 +764,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -796,7 +789,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -821,7 +813,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -836,8 +828,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -887,8 +879,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -914,7 +906,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -944,7 +935,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -962,8 +953,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1038,7 +1029,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1136,7 +1125,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1185,7 +1173,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1233,7 +1220,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1267,6 +1253,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1278,15 +1268,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1348,7 +1334,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_application_security_groups_operations_async.py index e1cc33b3a682..f2b6e53c11e5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -352,7 +348,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -379,7 +374,7 @@ async def begin_update_tags( application_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -394,8 +389,8 @@ async def begin_update_tags( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -455,6 +450,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -466,15 +465,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -533,15 +532,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_delegations_operations_async.py index a4120781c732..46b0c929111c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_endpoint_services_operations_async.py index 06e10d347aa8..a99d98e725e4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_private_endpoint_types_operations_async.py index aac4593be5ea..71da224ccada 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_private_endpoint_types_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -62,6 +62,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -146,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 11b9d044a287..87adc97e06b8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_service_aliases_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_service_aliases_operations_async.py index 342bbf02939e..3ff23e7eb23a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_service_aliases_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_available_service_aliases_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -131,6 +131,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 3d8fabc4705f..d3100535c0db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_azure_firewalls_operations_async.py index b4bc17850ef4..0e62a969fc4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_bastion_hosts_operations_async.py index c7bac789d1f4..95e9a1470467 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_bastion_hosts_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('BastionHost', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( bastion_host_name: str, parameters: "models.BastionHost", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_bgp_service_communities_operations_async.py index 7b827edd3a2c..45d1430ff6d6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_connection_monitors_operations_async.py index ce2b017d4167..06857a6db761 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -387,7 +383,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -438,7 +433,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -459,7 +453,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -474,8 +468,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -544,7 +538,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -565,7 +558,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -580,8 +573,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -651,7 +644,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -661,7 +653,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -680,7 +671,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -695,8 +686,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -762,6 +753,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -775,15 +770,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_ddos_custom_policies_operations_async.py index 3c2f094068be..0dd084f0ea0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -350,7 +346,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -377,7 +372,7 @@ async def begin_update_tags( ddos_custom_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. @@ -392,8 +387,8 @@ async def begin_update_tags( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_ddos_protection_plans_operations_async.py index e1ee722c5491..52d8f7a519ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( ddos_protection_plan_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_default_security_rules_operations_async.py index f46f7d87972e..000171eaac8c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index c67817e4a49d..d143c32fd386 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index be8563a9d2d7..42109e640ed2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 999fe264d263..40838c900e6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuits_operations_async.py index e0f394b3cd58..f9b71f20bd7a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( circuit_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -444,8 +439,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -469,7 +464,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +489,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -513,8 +507,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -565,8 +559,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -590,7 +584,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -616,7 +609,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -634,8 +627,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -686,8 +679,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -711,7 +704,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -737,7 +729,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -755,8 +747,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -839,7 +831,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -899,7 +890,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -936,6 +926,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -948,15 +942,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1000,6 +990,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1011,15 +1005,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_connections_operations_async.py index 39e22213783f..1d25b467bad2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index 17d98301884f..14e1023bb8ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_cross_connections_operations_async.py index d5a36349998d..dd090271260e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -378,7 +376,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,7 +402,7 @@ async def begin_update_tags( cross_connection_name: str, cross_connection_parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -421,8 +418,8 @@ async def begin_update_tags( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -472,8 +469,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -497,7 +494,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -523,7 +519,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -541,8 +537,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -593,8 +589,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -618,7 +614,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -644,7 +639,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -662,8 +657,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -714,8 +709,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -739,7 +734,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -765,7 +759,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -783,8 +777,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_gateways_operations_async.py index 264f7a1c686e..8a3e3ae70cc9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_links_operations_async.py index 7c2fc70fa6c4..82adcd0f9ade 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_ports_locations_operations_async.py index ee9b81116018..650b52862b9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_ports_operations_async.py index bd220b39c9fb..a01da8cc641c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( express_route_port_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -521,6 +516,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_service_providers_operations_async.py index dd8f95874d77..5ca93b261bda 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_firewall_policies_operations_async.py index c5e4189e57f2..d60c49e931d0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_firewall_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(firewall_policy_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -300,7 +297,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ 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('FirewallPolicy', pipeline_response) @@ -332,7 +327,7 @@ async def begin_create_or_update( firewall_policy_name: str, parameters: "models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": + ) -> AsyncLROPoller["models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -347,8 +342,8 @@ async def begin_create_or_update( 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: FirewallPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.FirewallPolicy + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.FirewallPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -411,6 +406,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -423,15 +422,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -475,6 +470,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py index 64c392856a9b..2052fbff457a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_group_name: str, parameters: "models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: FirewallPolicyRuleGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.FirewallPolicyRuleGroup + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.FirewallPolicyRuleGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 0f9cfd265e99..faa7461e7bd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 02dfac4537d7..a391b33fd949 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 96423ab721b4..45e601cf3c86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index b69ef098536f..869efe6856ba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index d60367624438..3ea0ab3e941a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 23790b4fd93d..5432a7aaa137 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 588d1caa90ad..e2ce17ca219c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_probes_operations_async.py index 94832a41c827..df5a324feb2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancers_operations_async.py index 7a71a131525e..f766c67b9be4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( load_balancer_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_local_network_gateways_operations_async.py index 33f766d333f6..3d8ce7046732 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( local_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.LocalNetworkGateway": + ) -> AsyncLROPoller["models.LocalNetworkGateway"]: """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -457,6 +452,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -469,15 +468,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_nat_gateways_operations_async.py index 46a760f4727a..710b237f33d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 0f37306ced79..6b2a3cd9deb2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index a7e4f13c118e..8ab0c0219e68 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 0be7b19ab46c..5dc7908985f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interfaces_operations_async.py index 7234a1b117f1..0beaf9a34fd0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( network_interface_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -577,8 +572,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -600,7 +595,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -624,7 +618,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -637,8 +631,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -685,8 +679,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -708,7 +702,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -732,7 +725,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -745,8 +738,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -815,6 +808,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -829,15 +826,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -887,6 +880,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -900,15 +897,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -987,7 +980,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1036,6 +1028,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1053,15 +1049,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1144,7 +1136,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_management_client_operations_async.py index c23f3c3bf7ff..ed1722d841fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_management_client_operations_async.py @@ -62,7 +62,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -119,7 +118,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -142,8 +140,8 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -167,7 +165,6 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -196,7 +193,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": + ) -> AsyncLROPoller["models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -214,8 +211,8 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_profiles_operations_async.py index 2768310c3ac2..af87d1222631 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_security_groups_operations_async.py index 148d718cc7af..19ac934e9607 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( network_security_group_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.NetworkSecurityGroup": + ) -> AsyncLROPoller["models.NetworkSecurityGroup"]: """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update_tags( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_watchers_operations_async.py index f07802333ec9..85367ba795b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "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 @@ -1851,8 +1823,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_operations_async.py index 719d5bd1a7d3..b8f412b3327e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index 7245058fce38..3b70610c37db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -253,7 +250,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -266,7 +262,6 @@ async def _update_tags_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('P2SVpnGateway', pipeline_response) @@ -285,7 +280,7 @@ async def begin_update_tags( gateway_name: str, p2_s_vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -301,8 +296,8 @@ async def begin_update_tags( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +367,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -391,7 +385,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -404,8 +398,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -464,6 +458,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -476,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -528,6 +522,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -539,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -580,8 +574,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -605,7 +599,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -634,7 +627,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -650,8 +643,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -699,8 +692,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> Optional["models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -722,7 +715,6 @@ async def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -746,7 +738,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -760,8 +752,8 @@ async def begin_get_p2_s_vpn_connection_health( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -809,8 +801,8 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "models.P2SVpnConnectionHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + ) -> Optional["models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -834,7 +826,6 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -863,7 +854,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "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. @@ -879,8 +870,8 @@ async def begin_get_p2_s_vpn_connection_health_detailed( 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: P2SVpnConnectionHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.P2SVpnConnectionHealth + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.P2SVpnConnectionHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_packet_captures_operations_async.py index 6900ce603453..63aee7266656 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index 0f4548afc2af..c34d8a3bf6d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_private_endpoints_operations_async.py index cbbd2839ce36..3a02814bc82d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_private_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_private_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, private_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( private_endpoint_name: str, parameters: "models.PrivateEndpoint", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateEndpoint + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.PrivateEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_private_link_services_operations_async.py index 4132a63f4779..6d4068f39109 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_private_link_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_private_link_services_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, service_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( service_name: str, parameters: "models.PrivateLinkService", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateLinkService, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateLinkService + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.PrivateLinkService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -508,7 +504,6 @@ async def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -559,7 +554,6 @@ async def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -580,7 +574,7 @@ async def begin_delete_private_endpoint_connection( service_name: str, pe_connection_name: str, **kwargs - ) -> None: + ) -> 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. @@ -595,8 +589,8 @@ async def begin_delete_private_endpoint_connection( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -636,31 +630,20 @@ def get_long_running_output(pipeline_response): 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 - async def check_private_link_service_visibility( + async def _check_private_link_service_visibility_initial( self, location: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "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.v2019_08_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + ) -> Optional["models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -676,7 +659,6 @@ async def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -685,47 +667,96 @@ async def check_private_link_service_visibility( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - async def check_private_link_service_visibility_by_resource_group( + async def begin_check_private_link_service_visibility( self, location: str, - resource_group_name: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": - """Checks whether the subscription is visible to private link service in the specified resource - group. + ) -> 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 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.v2019_08_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_08_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -742,7 +773,6 @@ async def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -751,17 +781,85 @@ async def check_private_link_service_visibility_by_resource_group( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_08_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.v2019_08_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -784,6 +882,10 @@ def list_auto_approved_private_link_services( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -796,15 +898,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -855,6 +953,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -868,15 +970,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_public_ip_addresses_operations_async.py index dd784080afdb..4b59c63e77cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_address_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPAddress": + ) -> AsyncLROPoller["models.PublicIPAddress"]: """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -595,6 +590,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -608,15 +607,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -676,6 +671,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -692,15 +691,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -787,7 +782,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_public_ip_prefixes_operations_async.py index ddf624752cda..d8fd8bd0e880 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( public_ip_prefix_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.PublicIPPrefix": + ) -> AsyncLROPoller["models.PublicIPPrefix"]: """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_resource_navigation_links_operations_async.py index ab2f0d8f2b7c..28c2be8c119f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_filter_rules_operations_async.py index 08612821ae6a..dd87032232f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_update( rule_name: str, route_filter_rule_parameters: "models.PatchRouteFilterRule", **kwargs - ) -> "models.RouteFilterRule": + ) -> AsyncLROPoller["models.RouteFilterRule"]: """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -484,6 +479,10 @@ def list_by_route_filter( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_filters_operations_async.py index fdd117d05d0a..8e2c4cb25d03 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( route_filter_name: str, route_filter_parameters: "models.PatchRouteFilter", **kwargs - ) -> "models.RouteFilter": + ) -> AsyncLROPoller["models.RouteFilter"]: """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -463,6 +458,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -475,15 +474,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -527,6 +522,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_tables_operations_async.py index 34faf5ece01e..9c556ac12644 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( route_table_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.RouteTable": + ) -> AsyncLROPoller["models.RouteTable"]: """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -462,6 +457,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -474,15 +473,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_routes_operations_async.py index 2acc3f3c55be..d02577d5a1c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_security_rules_operations_async.py index ce170fbf93bb..f652bf54807e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_association_links_operations_async.py index f1ae30f56e6c..f6d8d26f13a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_endpoint_policies_operations_async.py index d59b9ac8d6e8..e6cad9036e6c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -357,7 +353,6 @@ async def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update( service_endpoint_policy_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -399,8 +394,8 @@ async def begin_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -460,6 +455,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +521,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -538,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index 478d0751ae85..d78fe12bed72 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_tags_operations_async.py index 265c115824a1..b7010598235d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_service_tags_operations_async.py @@ -77,7 +77,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_subnets_operations_async.py index 5664eba2bafa..68bbd87c82ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -490,7 +485,6 @@ async def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -515,7 +509,7 @@ async def begin_unprepare_network_policies( subnet_name: str, unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -533,8 +527,8 @@ async def begin_unprepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -598,6 +592,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -611,15 +609,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_usages_operations_async.py index cf3c763749df..60d9e05d927e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_hubs_operations_async.py index 1e0f3a1d0f61..9ef7b0ae4b94 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualHub', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -252,7 +249,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -265,7 +261,6 @@ async def _update_tags_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('VirtualHub', pipeline_response) @@ -284,7 +279,7 @@ async def begin_update_tags( virtual_hub_name: str, virtual_hub_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualHub": + ) -> AsyncLROPoller["models.VirtualHub"]: """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -299,8 +294,8 @@ async def begin_update_tags( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +365,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +383,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -402,8 +396,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -462,6 +456,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -474,15 +472,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +520,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +535,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index bea5d4ae65e4..60972f7c698c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -330,8 +326,8 @@ async def _update_tags_initial( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> Optional["models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -400,8 +395,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,7 +470,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -488,7 +482,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -507,7 +500,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -525,8 +518,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -610,7 +603,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -648,6 +640,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -660,15 +656,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -701,8 +693,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -726,7 +718,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -755,7 +746,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -774,8 +765,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -824,8 +815,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -849,7 +840,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -882,7 +872,7 @@ async def begin_start_packet_capture( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> 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. @@ -899,8 +889,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -949,8 +939,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -974,7 +964,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1004,7 +993,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> 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. @@ -1021,8 +1010,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 326b84857088..661bb7ddce55 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -326,8 +322,8 @@ async def _update_tags_initial( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,6 +524,10 @@ def list_connections( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -542,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -583,8 +578,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -608,7 +603,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -633,7 +627,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -649,8 +643,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -720,7 +714,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -739,7 +732,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -753,8 +746,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -799,8 +792,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -824,7 +817,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -853,7 +845,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -870,8 +862,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -920,8 +912,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -945,7 +937,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -974,7 +965,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -991,8 +982,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1040,8 +1031,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1063,7 +1054,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1101,8 +1091,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1150,8 +1140,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1175,7 +1165,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1200,7 +1189,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1215,8 +1204,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1298,7 +1287,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1320,8 +1308,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1343,7 +1331,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1367,7 +1354,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1381,8 +1368,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1430,8 +1417,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1454,7 +1441,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1479,7 +1465,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1495,8 +1481,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1545,8 +1531,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1570,7 +1556,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1599,7 +1584,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1616,8 +1601,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1688,7 +1673,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1710,7 +1694,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1725,8 +1709,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1797,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1840,8 +1823,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1865,7 +1848,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1898,7 +1880,7 @@ async def begin_start_packet_capture( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -1914,8 +1896,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1964,8 +1946,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1989,7 +1971,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2019,7 +2000,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2035,8 +2016,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -2084,8 +2065,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientConnectionHealthDetailListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -2107,7 +2088,6 @@ async def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -2131,7 +2111,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -2145,8 +2125,8 @@ async def begin_get_vpnclient_connection_health( 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: VpnClientConnectionHealthDetailListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnClientConnectionHealthDetailListResult + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnClientConnectionHealthDetailListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 629bceaef80e..a8e362339278 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_taps_operations_async.py index 6b7ccac6f37b..c4412205a31c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -378,7 +373,7 @@ async def begin_update_tags( tap_name: str, tap_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -393,8 +388,8 @@ async def begin_update_tags( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -454,6 +449,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -465,15 +464,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -520,6 +515,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -532,15 +531,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_networks_operations_async.py index d7a95e7ecf33..a8200e7792b5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -356,7 +352,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -383,7 +378,7 @@ async def begin_update_tags( virtual_network_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetwork": + ) -> AsyncLROPoller["models.VirtualNetwork"]: """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -398,8 +393,8 @@ async def begin_update_tags( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -470,15 +469,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,6 +520,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +536,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -615,7 +610,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -655,6 +649,10 @@ def list_usage( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -668,15 +666,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_router_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_router_peerings_operations_async.py index b90d1067cd15..8afb04958526 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_router_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_router_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -93,7 +92,7 @@ async def begin_delete( virtual_router_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -192,7 +191,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -258,7 +256,6 @@ async def update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -313,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -327,7 +323,6 @@ async def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -347,7 +342,7 @@ async def begin_create_or_update( peering_name: str, parameters: "models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": + ) -> AsyncLROPoller["models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -365,8 +360,8 @@ async def begin_create_or_update( 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: VirtualRouterPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouterPeering + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualRouterPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -433,6 +428,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -446,15 +445,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_routers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_routers_operations_async.py index 501442ff4686..4844ed05236b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_routers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_routers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -249,7 +247,6 @@ async def update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -302,7 +299,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -316,7 +312,6 @@ async def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -335,7 +330,7 @@ async def begin_create_or_update( virtual_router_name: str, parameters: "models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": + ) -> AsyncLROPoller["models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -350,8 +345,8 @@ async def begin_create_or_update( 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: VirtualRouter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualRouter + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualRouter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -414,6 +409,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +425,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -479,6 +474,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -490,15 +489,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_wans_operations_async.py index d792fcb64138..d050cbdb43f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualWAN', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -252,7 +249,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -265,7 +261,6 @@ async def _update_tags_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('VirtualWAN', pipeline_response) @@ -284,7 +279,7 @@ async def begin_update_tags( virtual_wan_name: str, wan_parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualWAN": + ) -> AsyncLROPoller["models.VirtualWAN"]: """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -299,8 +294,8 @@ async def begin_update_tags( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +365,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +383,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -402,8 +396,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -462,6 +456,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -474,15 +472,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +520,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +535,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_connections_operations_async.py index a6348f03aa40..ddf62010eaff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -136,7 +135,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnConnection', pipeline_response) @@ -169,7 +166,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -187,8 +184,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -261,7 +258,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -281,7 +277,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -296,8 +292,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,6 +356,10 @@ def list_by_vpn_gateway( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_gateways_operations_async.py index a4f227b8af0f..e91bc4046101 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -253,7 +250,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -266,7 +262,6 @@ async def _update_tags_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('VpnGateway', pipeline_response) @@ -285,7 +280,7 @@ async def begin_update_tags( gateway_name: str, vpn_gateway_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnGateway": + ) -> AsyncLROPoller["models.VpnGateway"]: """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -300,8 +295,8 @@ async def begin_update_tags( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -371,7 +366,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -390,7 +384,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -403,8 +397,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -448,8 +442,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> Optional["models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -471,7 +465,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -495,7 +488,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> "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. @@ -508,8 +501,8 @@ async def begin_reset( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -571,6 +564,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -583,15 +580,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -635,6 +628,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -646,15 +643,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_link_connections_operations_async.py index f6107421adcd..ae579ca54740 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -68,6 +68,10 @@ def list_by_vpn_connection( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py index f5c8445e1d31..01b035873054 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VpnServerConfigurationsResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + ) -> Optional["models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -70,7 +70,6 @@ async def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "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. @@ -108,8 +107,8 @@ async def begin_list( 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: VpnServerConfigurationsResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnServerConfigurationsResponse + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationsResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnServerConfigurationsResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_server_configurations_operations_async.py index ce737ecb03bd..3fbba3a08e6c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_server_configurations_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_server_configuration_name: str, vpn_server_configuration_parameters: "models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> AsyncLROPoller["models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -255,7 +252,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -268,7 +264,6 @@ async def _update_tags_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('VpnServerConfiguration', pipeline_response) @@ -287,7 +282,7 @@ async def begin_update_tags( vpn_server_configuration_name: str, vpn_server_configuration_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> AsyncLROPoller["models.VpnServerConfiguration"]: """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -303,8 +298,8 @@ async def begin_update_tags( 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: VpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +369,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -393,7 +387,7 @@ async def begin_delete( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -406,8 +400,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -466,6 +460,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -478,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -530,6 +524,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -541,15 +539,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_site_link_connections_operations_async.py index 73375eece7f1..b2f613323413 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_site_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_site_link_connections_operations_async.py @@ -87,7 +87,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_site_links_operations_async.py index 3ac07e108f75..d3fdb3380ad2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_site_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list_by_vpn_site( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index de5171890978..c137dc60fcbd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -96,7 +95,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -112,8 +111,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_sites_operations_async.py index dcdb522159e3..ffdf27d159ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnSite', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -252,7 +249,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -265,7 +261,6 @@ async def _update_tags_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('VpnSite', pipeline_response) @@ -284,7 +279,7 @@ async def begin_update_tags( vpn_site_name: str, vpn_site_parameters: "models.TagsObject", **kwargs - ) -> "models.VpnSite": + ) -> AsyncLROPoller["models.VpnSite"]: """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -299,8 +294,8 @@ async def begin_update_tags( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_08_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +365,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -389,7 +383,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -402,8 +396,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -462,6 +456,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -474,15 +472,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -526,6 +520,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -537,15 +535,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index 6a7eb202691c..7448a5135f34 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] 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 0b4dd8db6e06..b3eb021a51d8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -608,7 +603,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -628,7 +622,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -709,7 +703,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +722,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -789,8 +782,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -814,7 +807,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -840,7 +832,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -907,8 +899,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -934,7 +926,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -965,7 +956,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1060,7 +1051,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1160,7 +1149,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1210,7 +1198,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1259,7 +1246,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1294,6 +1280,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1305,15 +1295,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1376,7 +1362,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 44669c5234d3..f4e38be8c818 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -362,7 +358,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -390,7 +385,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Updates an application security group's tags. :param resource_group_name: The name of the resource group. @@ -467,6 +462,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -478,15 +477,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -546,15 +545,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 647fc52b6172..c5fb3b24373c 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 75d4ebe5aa80..3d03efb8c120 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e9a3620581cc..3b0af348e47f 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 @@ -67,6 +67,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,6 +139,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -152,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c37a73e161d2..3ede3bc4acb3 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4091161e8d69..590c2194346e 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -137,6 +137,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -150,15 +154,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b92f1fc2c1d9..c38a0d6c1382 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fae6a1e3ab42..b0f7dc5a45b4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b3c86b3b219b..2192466a3556 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('BastionHost', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f026ee0f4efa..3812ab82c7a2 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4b16b4aa27f8..6ccb172260d2 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -397,7 +393,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -449,7 +444,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -471,7 +465,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -557,7 +551,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -579,7 +572,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -666,7 +659,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +668,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -696,7 +687,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -779,6 +770,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -792,15 +787,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b81aef9c6c5e..ab34be4b6f9d 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -360,7 +356,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -388,7 +383,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Update a DDoS custom policy tags. :param resource_group_name: The name of the resource group. 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 68337623e45f..6d3eaa20f0fe 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Update a DDoS protection plan tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 70d13d2c995d..29555267030e 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 4a86b111802f..a80a1d2a1c1e 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b5d90e87f305..07c6d253db42 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b510f06a63e2..82741089baa6 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bed40220fe3d..c5b4a81466c4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -456,8 +451,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -481,7 +476,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +502,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -579,8 +573,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -604,7 +598,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +624,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -702,8 +695,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -727,7 +720,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -754,7 +746,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -857,7 +849,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -918,7 +909,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -956,6 +946,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -968,15 +962,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1021,6 +1011,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -1032,15 +1026,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c07ca6227563..fac3656d0119 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ba05f372f103..97d3ca2024a3 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 f36ad5c1967a..011ce2a3c498 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -388,7 +386,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,7 +413,7 @@ def begin_update_tags( cross_connection_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Updates an express route cross connection tags. :param resource_group_name: The name of the resource group. @@ -484,8 +481,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -509,7 +506,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -536,7 +532,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -607,8 +603,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -632,7 +628,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -659,7 +654,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -730,8 +725,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -755,7 +750,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,7 +776,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 8c623c57dc6b..c7e9c397b892 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 61b5efe01e75..99b7aca6c4f0 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 491acf9d42b9..7661bc025700 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d6b801a6ad06..dace88866c48 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Update ExpressRoutePort tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -534,6 +529,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fae4a63530c3..8520bfbe036e 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 524bcf17a034..973afc242ec2 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(firewall_policy_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -309,7 +306,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ 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('FirewallPolicy', pipeline_response) @@ -342,7 +337,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -422,6 +417,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -434,15 +433,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -487,6 +482,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8c9033386c6a..891bb37e7fac 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 649f7d9bb0fc..ff02049d6875 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4c9c0d188634..892655ff0d35 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 e3b0df155959..2e70b6156552 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 9a01a9b4888c..21c5a8098c41 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 12a380b6e74b..bd63669f6f27 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5be02c4c883d..672019f114a8 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c03dd9b52a71..eea6bffdd6d3 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 7468f5d0c313..683d2c7977a2 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 9d0ccd642e2b..59a7aabbed30 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 88195ee60e34..2f789c0fe43d 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LocalNetworkGateway"] """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -469,6 +464,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8054cbb204f5..1d9cf92fb92a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cb9ca2551ebf..f4a072470014 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e42bd6eccf89..610fff645b55 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e24fc14336f3..538282d8858b 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2e1e9a8b2065..535ad67598a6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -591,8 +586,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -614,7 +609,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -639,7 +633,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -701,8 +695,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -724,7 +718,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -749,7 +742,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -833,6 +826,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -847,15 +844,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -906,6 +899,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -919,15 +916,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1007,7 +1000,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,6 +1049,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1074,15 +1070,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1166,7 +1158,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 eed0e2f7df4b..5a9da6681ca6 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 @@ -67,7 +67,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -125,7 +124,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -149,8 +147,8 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -174,7 +172,6 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -204,7 +201,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. 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 3a5c87e05909..1563feb08642 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ff71c723d4b8..e84112611dc9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkSecurityGroup"] """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f22a8108311e..fc9a771888f2 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 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 326b1b08d438..7f3b806310e7 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 093ae1f2439b..028fd344fe93 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -261,7 +258,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -274,7 +270,6 @@ def _update_tags_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('P2SVpnGateway', pipeline_response) @@ -294,7 +289,7 @@ def begin_update_tags( p2_s_vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Updates virtual wan p2s vpn gateway tags. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -382,7 +377,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -402,7 +396,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -476,6 +470,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -488,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -541,6 +535,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -552,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -594,8 +588,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -619,7 +613,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -649,7 +642,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -715,8 +708,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> Optional["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -738,7 +731,6 @@ def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -763,7 +755,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -827,8 +819,8 @@ def _get_p2_s_vpn_connection_health_detailed_initial( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnConnectionHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + # type: (...) -> Optional["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -852,7 +844,6 @@ def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -882,7 +873,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 f2b36c99d13e..98b4d95113cb 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5279eb7b40a9..158244f8a590 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 34c05725940f..a3351a3acf3c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( private_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 be42f414a9d5..a5af28654cbd 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -520,7 +516,6 @@ def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -572,7 +567,6 @@ def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -594,7 +588,7 @@ def begin_delete_private_endpoint_connection( pe_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -650,32 +644,21 @@ def get_long_running_output(pipeline_response): 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 check_private_link_service_visibility( + def _check_private_link_service_visibility_initial( self, location, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "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.v2019_08_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -691,7 +674,6 @@ def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -700,48 +682,98 @@ def check_private_link_service_visibility( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - def check_private_link_service_visibility_by_resource_group( + def begin_check_private_link_service_visibility( self, location, # type: str - resource_group_name, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" - """Checks whether the subscription is visible to private link service in the specified resource - group. + # 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 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.v2019_08_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_08_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_08_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -758,7 +790,6 @@ def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -767,17 +798,86 @@ def check_private_link_service_visibility_by_resource_group( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_08_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.v2019_08_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -801,6 +901,10 @@ def list_auto_approved_private_link_services( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -813,15 +917,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -873,6 +973,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -886,15 +990,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5ffaec9a75e8..f1cf771be74b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -609,6 +604,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -622,15 +621,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -691,6 +686,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -707,15 +706,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -803,7 +798,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 f4c6a078f613..0e5c855af0bb 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Updates public IP prefix tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 53ba9816a474..5b29b9f6cf45 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 45139001ee8f..bf237eb41a72 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_update( route_filter_rule_parameters, # type: "models.PatchRouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -496,6 +491,10 @@ def list_by_route_filter( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -509,15 +508,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 181189d0dd97..aaa3a93d810a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( route_filter_parameters, # type: "models.PatchRouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilter"] """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -475,6 +470,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -487,15 +486,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -540,6 +535,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 39b37001184e..dfed7a1f5d32 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteTable"] """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -474,6 +469,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 08496202af41..e03b0f98e5b0 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b1df5e660a47..1fa1076240c0 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d80a18e37eaf..acb1867f7bd8 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 253756747dc1..ec720342aa88 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -367,7 +363,6 @@ def _update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Updates service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -472,6 +467,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +534,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -551,15 +550,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e272fa0a4286..e0c7f35187ba 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5ac5cb9e2131..26fb69c101a8 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 @@ -82,7 +82,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ebc3b3d3e8fa..bc62123808b7 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -502,7 +497,6 @@ def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -528,7 +522,7 @@ def begin_unprepare_network_policies( unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -612,6 +606,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -625,15 +623,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 480b567b18d2..b694152684e4 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0946faa787c2..4185ec08d41d 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualHub', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -260,7 +257,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -273,7 +269,6 @@ def _update_tags_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('VirtualHub', pipeline_response) @@ -293,7 +288,7 @@ def begin_update_tags( virtual_hub_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHub"] """Updates VirtualHub tags. :param resource_group_name: The resource group name of the VirtualHub. @@ -380,7 +375,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +394,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -474,6 +468,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -486,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +533,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +548,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9c055a27418d..0393106f1667 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -340,8 +336,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -487,7 +482,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -500,7 +494,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -520,7 +513,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -624,7 +617,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,6 +655,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -675,15 +671,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -717,8 +709,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -742,7 +734,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -772,7 +763,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -842,8 +833,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -867,7 +858,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -901,7 +891,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -969,8 +959,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -994,7 +984,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1025,7 +1014,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 069798398f69..e0543f0eb1f6 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,6 +537,10 @@ def list_connections( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -555,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -597,8 +592,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -622,7 +617,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -648,7 +642,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -736,7 +730,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -756,7 +749,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -817,8 +810,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -842,7 +835,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -940,8 +932,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -965,7 +957,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -995,7 +986,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1062,8 +1053,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1085,7 +1076,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1174,8 +1164,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1199,7 +1189,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1225,7 +1214,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1324,7 +1313,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1347,8 +1335,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1370,7 +1358,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1395,7 +1382,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1459,8 +1446,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1483,7 +1470,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1509,7 +1495,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1576,8 +1562,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1601,7 +1587,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1631,7 +1616,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1721,7 +1706,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1744,7 +1728,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1848,7 +1832,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1876,8 +1859,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -1901,7 +1884,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1935,7 +1917,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2002,8 +1984,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -2027,7 +2009,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2058,7 +2039,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2124,8 +2105,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientConnectionHealthDetailListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -2147,7 +2128,6 @@ def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2172,7 +2152,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. 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 037e4f36ad97..e051b8fa40c6 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 05b084b9b731..854f2997f827 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -389,7 +384,7 @@ def begin_update_tags( tap_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Updates an VirtualNetworkTap tags. :param resource_group_name: The name of the resource group. @@ -466,6 +461,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -477,15 +476,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -533,6 +528,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -545,15 +544,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 239fb2c8df83..d4c9f356acf3 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -366,7 +362,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -394,7 +389,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetwork"] """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,6 +533,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +549,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -629,7 +624,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -670,6 +664,10 @@ def list_usage( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -683,15 +681,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b2c21007b8ad..b955a3ee98d9 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +98,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -199,7 +198,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -266,7 +264,6 @@ def update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -322,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -336,7 +332,6 @@ def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -357,7 +352,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -444,6 +439,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -457,15 +456,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5bd9bbb0ae5d..5879b7065207 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -257,7 +255,6 @@ def update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -311,7 +308,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -325,7 +321,6 @@ def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -345,7 +340,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -425,6 +420,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -437,15 +436,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -491,6 +486,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -502,15 +501,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 76f06a2361dd..09810b17d6fa 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualWAN', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -260,7 +257,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -273,7 +269,6 @@ def _update_tags_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('VirtualWAN', pipeline_response) @@ -293,7 +288,7 @@ def begin_update_tags( wan_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualWAN"] """Updates a VirtualWAN tags. :param resource_group_name: The resource group name of the VirtualWan. @@ -380,7 +375,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +394,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -474,6 +468,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -486,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +533,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +548,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 879d8c35b274..20f1940450bc 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -142,7 +141,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -155,7 +153,6 @@ 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('VpnConnection', pipeline_response) @@ -176,7 +173,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -269,7 +266,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -290,7 +286,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -370,6 +366,10 @@ def list_by_vpn_gateway( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4bc29308a6bc..c3405b3e7db2 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -261,7 +258,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -274,7 +270,6 @@ def _update_tags_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('VpnGateway', pipeline_response) @@ -294,7 +289,7 @@ def begin_update_tags( vpn_gateway_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnGateway"] """Updates virtual wan vpn gateway tags. :param resource_group_name: The resource group name of the VpnGateway. @@ -381,7 +376,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -401,7 +395,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -460,8 +454,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> Optional["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -483,7 +477,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -508,7 +501,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -585,6 +578,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -597,15 +594,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -650,6 +643,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -661,15 +658,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c34b7e02a80e..0698193eff08 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 @@ -73,6 +73,10 @@ def list_by_vpn_connection( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -87,15 +91,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d0344ea9b5b0..2e97706daa01 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 @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfigurationsResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-08-01" @@ -75,7 +75,6 @@ def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 208dce85789e..cefcc852b2a2 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -263,7 +260,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -276,7 +272,6 @@ def _update_tags_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('VpnServerConfiguration', pipeline_response) @@ -296,7 +291,7 @@ def begin_update_tags( vpn_server_configuration_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnServerConfiguration"] """Updates VpnServerConfiguration tags. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -384,7 +379,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -404,7 +398,7 @@ def begin_delete( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -478,6 +472,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -490,15 +488,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -543,6 +537,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -554,15 +552,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f39072a42def..897bddfda6a9 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 @@ -92,7 +92,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 fd535591e371..77a5f7cf1135 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list_by_vpn_site( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6e01f014bc3e..d9764f5e5615 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -102,7 +101,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 a879a88d0b66..a86793cbc69f 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnSite', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -260,7 +257,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -273,7 +269,6 @@ def _update_tags_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('VpnSite', pipeline_response) @@ -293,7 +288,7 @@ def begin_update_tags( vpn_site_parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnSite"] """Updates VpnSite tags. :param resource_group_name: The resource group name of the VpnSite. @@ -380,7 +375,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -400,7 +394,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -474,6 +468,10 @@ def list_by_resource_group( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -486,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -539,6 +533,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -550,15 +548,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0f3bd44c03de..5826b5aec13e 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 @@ -68,6 +68,10 @@ def list( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2019-08-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 9fc52c8afc22..0c69e698bb78 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 @@ -136,51 +136,43 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "operation_name": "_put_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_put_bastion_shareable_link_initial", - "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 \"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", "coroutine": true }, "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" }, - "put_bastion_shareable_link" : { + "begin_put_bastion_shareable_link" : { "sync": { - "operation_name": "begin_put_bastion_shareable_link", "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" }, "async": { - "operation_name": "put_bastion_shareable_link", - "signature": "async def 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 \"models.BastionShareableLinkListResult\":\n", + "signature": "async 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[\"models.BastionShareableLinkListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "_delete_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_delete_bastion_shareable_link_initial", "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", "coroutine": true }, "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" }, - "delete_bastion_shareable_link" : { + "begin_delete_bastion_shareable_link" : { "sync": { - "operation_name": "begin_delete_bastion_shareable_link", "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" }, "async": { - "operation_name": "delete_bastion_shareable_link", - "signature": "async def 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 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", "coroutine": true }, "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:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", @@ -188,11 +180,9 @@ }, "get_bastion_shareable_link" : { "sync": { - "operation_name": "get_bastion_shareable_link", "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" }, "async": { - "operation_name": "get_bastion_shareable_link", "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", "coroutine": false }, @@ -201,37 +191,31 @@ }, "_get_active_sessions_initial" : { "sync": { - "operation_name": "_get_active_sessions_initial", "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" }, "async": { - "operation_name": "_get_active_sessions_initial", - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"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", "coroutine": true }, "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" }, - "get_active_sessions" : { + "begin_get_active_sessions" : { "sync": { - "operation_name": "begin_get_active_sessions", "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" }, "async": { - "operation_name": "get_active_sessions", - "signature": "async def get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"models.BastionActiveSessionListResult\":\n", + "signature": "async def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.BastionActiveSessionListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "disconnect_active_sessions", "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" }, "async": { - "operation_name": "disconnect_active_sessions", "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", "coroutine": false }, @@ -240,11 +224,9 @@ }, "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -253,11 +235,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -266,31 +246,27 @@ }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", "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" }, "async": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", - "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 \"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", "coroutine": true }, "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" }, - "generatevirtualwanvpnserverconfigurationvpnprofile" : { + "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "operation_name": "begin_generatevirtualwanvpnserverconfigurationvpnprofile", "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" }, "async": { - "operation_name": "generatevirtualwanvpnserverconfigurationvpnprofile", - "signature": "async def generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e \"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", "coroutine": true }, - "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: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\"\"\"", + "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:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~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" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.paging import ItemPaged\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.arm_polling import ARMPolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union", - "async_imports": "from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.async_paging import AsyncItemPaged, AsyncList\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"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\": [\"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/v2019_09_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_application_gateways_operations_async.py index bb62e674fd68..a502154c08a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -542,7 +537,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -561,7 +555,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -574,8 +568,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -641,7 +635,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -660,7 +653,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -673,8 +666,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -719,8 +712,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -744,7 +737,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -769,7 +761,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -784,8 +776,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -835,8 +827,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -862,7 +854,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -892,7 +883,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -910,8 +901,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -986,7 +977,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1035,7 +1025,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1084,7 +1073,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1133,7 +1121,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1181,7 +1168,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1215,6 +1201,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1226,15 +1216,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1296,7 +1282,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_application_security_groups_operations_async.py index ad92e79db739..82976038fee9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -365,7 +361,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,6 +398,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -414,15 +413,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_delegations_operations_async.py index 89e4abb21c90..b812d7b2ce74 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_endpoint_services_operations_async.py index 847c6b301ab9..8911a332a408 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_private_endpoint_types_operations_async.py index e5cc09a4d78c..3857aacd2482 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_private_endpoint_types_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -62,6 +62,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -146,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 6a7e15a65ebe..ca2558108d86 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_service_aliases_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_service_aliases_operations_async.py index b5c42deff886..9b8e5bf1170b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_service_aliases_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_available_service_aliases_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -131,6 +131,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index e51b6fbabfbe..f84b0f0d9c63 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_azure_firewalls_operations_async.py index 6fcd351b458e..17fec7d568eb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -326,8 +322,8 @@ async def _update_tags_initial( azure_firewall_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> Optional["models.AzureFirewall"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( azure_firewall_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -523,6 +518,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -534,15 +533,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_bastion_hosts_operations_async.py index 3eb387fc7375..8caf50672476 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_bastion_hosts_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('BastionHost', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( bastion_host_name: str, parameters: "models.BastionHost", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_bgp_service_communities_operations_async.py index 1de1fe661152..6bd7941942d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_connection_monitors_operations_async.py index de2753d4c728..18cf618fb278 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -387,7 +383,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -438,7 +433,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -459,7 +453,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -474,8 +468,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -544,7 +538,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -565,7 +558,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -580,8 +573,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -651,7 +644,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -661,7 +653,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -680,7 +671,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -695,8 +686,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -762,6 +753,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -775,15 +770,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ddos_custom_policies_operations_async.py index f2809dba3966..df0a88fa6697 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,7 +359,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ddos_protection_plans_operations_async.py index f5441000686d..c3c8f2ce2a26 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_default_security_rules_operations_async.py index 064c7ef2bcf0..d68a9ecf15c4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 8542ff162010..165df3d75cf7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index f62d423167f1..78df3f17dd3a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index d32490cb90be..5d91088e80f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuits_operations_async.py index 7c49b0fa94fd..ba88ff0cd03c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -392,8 +387,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -417,7 +412,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -443,7 +437,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -461,8 +455,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -513,8 +507,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -538,7 +532,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -564,7 +557,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -582,8 +575,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -634,8 +627,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -659,7 +652,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -685,7 +677,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -703,8 +695,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -787,7 +779,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -847,7 +838,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -884,6 +874,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -896,15 +890,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -948,6 +938,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -959,15 +953,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_connections_operations_async.py index 94af2ebb0692..65ffabde32bb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index 897d6598b457..deae3f20a96b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 710dcaed8e81..f7b0775b3028 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -392,7 +390,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -420,8 +417,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -445,7 +442,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -471,7 +467,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -489,8 +485,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -541,8 +537,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -566,7 +562,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -592,7 +587,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -610,8 +605,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -662,8 +657,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -687,7 +682,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -713,7 +707,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -731,8 +725,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_gateways_operations_async.py index 485b839921ae..f5e4327f7972 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_links_operations_async.py index ac4e7267f8d7..0b048c7b32d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_ports_locations_operations_async.py index 5f8a5ccaaf39..32ebf0ffa6d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_ports_operations_async.py index 6eb7b7152a30..6a4b22ed7135 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_service_providers_operations_async.py index 1c473c12193e..8b5dbc0a5d39 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_firewall_policies_operations_async.py index 3e54000a2f50..261d6c91cdc6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_firewall_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('FirewallPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( firewall_policy_name: str, parameters: "models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": + ) -> AsyncLROPoller["models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: FirewallPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.FirewallPolicy + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.FirewallPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py index 40d6d7d92a58..80fcece64287 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_group_name: str, parameters: "models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: FirewallPolicyRuleGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.FirewallPolicyRuleGroup + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.FirewallPolicyRuleGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 7002923ec05f..a48cf437564b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_inbound_nat_rules_operations_async.py index a979705d8eff..4040f576c0f6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ip_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ip_groups_operations_async.py index bd0440a7f9bf..55f84a21d2ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ip_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_ip_groups_operations_async.py @@ -88,7 +88,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -170,7 +167,7 @@ async def begin_create_or_update( ip_groups_name: str, parameters: "models.IpGroup", **kwargs - ) -> "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. @@ -185,8 +182,8 @@ async def begin_create_or_update( 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: IpGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.IpGroup + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.IpGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -273,7 +270,6 @@ async def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -342,7 +337,7 @@ async def begin_delete( resource_group_name: str, ip_groups_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -355,8 +350,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -415,6 +410,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -427,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -491,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index f1ed555169d9..0001b527107d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 9fed65e68f37..013a26f53aed 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 89f1fdeabca8..9fcfd0231096 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index ab14c0a5114d..cd32a2e930f7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 592e53817c48..a9100386bd08 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_probes_operations_async.py index 7bc364c7ea7d..2f60826a3c84 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancers_operations_async.py index 8de828ddbb75..7d7c68727652 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_local_network_gateways_operations_async.py index 8e9a0faccffa..912b6a42ac07 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_nat_gateways_operations_async.py index 965ed999064f..320c9df73e66 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 040e9ae79fc9..09676a93f8ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index c4d867e631ec..df9ea5444dc2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index fb0fba9a55e9..fe39b10eac6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interfaces_operations_async.py index 56e304b0a7d3..4412b7259caa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,8 +520,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -548,7 +543,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -572,7 +566,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -585,8 +579,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -633,8 +627,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -656,7 +650,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -680,7 +673,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -693,8 +686,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -763,6 +756,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -777,15 +774,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -835,6 +828,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -848,15 +845,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -935,7 +928,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -984,6 +976,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1001,15 +997,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1092,7 +1084,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_management_client_operations_async.py index 85214bfe0777..5aeef87d99fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_management_client_operations_async.py @@ -29,8 +29,8 @@ async def _put_bastion_shareable_link_initial( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + ) -> Optional["models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -54,7 +54,6 @@ async def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -83,7 +82,7 @@ async def begin_put_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": + ) -> AsyncLROPoller["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. @@ -98,8 +97,8 @@ async def begin_put_bastion_shareable_link( 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: BastionShareableLinkListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult + :return: An instance of AsyncLROPoller that returns either BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.BastionShareableLinkListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -172,7 +171,6 @@ async def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -196,7 +194,7 @@ async def begin_delete_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> None: + ) -> 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. @@ -211,8 +209,8 @@ async def begin_delete_bastion_shareable_link( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -279,6 +277,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -292,19 +295,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -337,8 +339,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + ) -> Optional["models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -360,7 +362,6 @@ async def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -384,7 +385,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": + ) -> AsyncLROPoller["models.BastionActiveSessionListResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -397,8 +398,8 @@ async def begin_get_active_sessions( 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: BastionActiveSessionListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.BastionActiveSessionListResult + :return: An instance of AsyncLROPoller that returns either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.BastionActiveSessionListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -467,6 +468,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -480,19 +486,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -560,7 +565,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -617,7 +621,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -640,8 +643,8 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -665,7 +668,6 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -694,7 +696,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": + ) -> AsyncLROPoller["models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -712,8 +714,8 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_profiles_operations_async.py index e5155c11b6fe..68d843274c79 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_security_groups_operations_async.py index c2a2438ddb4d..2cd7db64202a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_watchers_operations_async.py index 7ef326f606bc..863b7a7f9abd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "models.AzureReachabilityReport": + ) -> AsyncLROPoller["models.AzureReachabilityReport"]: """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1601,8 +1577,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1676,7 +1652,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1690,7 +1665,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1709,7 +1683,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1724,8 +1698,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1799,7 +1773,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1813,7 +1786,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1832,7 +1804,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "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 @@ -1851,8 +1823,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_operations_async.py index 481e1bd62acd..e7f71e79ffbf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index f089090b34f7..0a2d3a7d37b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -267,7 +264,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -315,7 +311,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -334,7 +329,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -347,8 +342,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,6 +402,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -471,6 +466,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -523,8 +518,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -548,7 +543,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -577,7 +571,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -593,8 +587,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -642,8 +636,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> Optional["models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -665,7 +659,6 @@ async def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -689,7 +682,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -703,8 +696,8 @@ async def begin_get_p2_s_vpn_connection_health( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -752,8 +745,8 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "models.P2SVpnConnectionHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + ) -> Optional["models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -777,7 +770,6 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -806,7 +798,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "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. @@ -822,8 +814,8 @@ async def begin_get_p2_s_vpn_connection_health_detailed( 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: P2SVpnConnectionHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.P2SVpnConnectionHealth + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.P2SVpnConnectionHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_packet_captures_operations_async.py index 899217f2ced5..042aa8ffdbbd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index 95b960133237..469bd8040b67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_private_endpoints_operations_async.py index 86a16a53f41e..fd3b6b7f2c91 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_private_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_private_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, private_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( private_endpoint_name: str, parameters: "models.PrivateEndpoint", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateEndpoint + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.PrivateEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_private_link_services_operations_async.py index dc7f203974c6..a1142214ca8c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_private_link_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_private_link_services_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, service_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( service_name: str, parameters: "models.PrivateLinkService", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateLinkService, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateLinkService + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.PrivateLinkService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -509,7 +505,6 @@ async def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -575,7 +570,6 @@ async def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -626,7 +620,6 @@ async def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -647,7 +640,7 @@ async def begin_delete_private_endpoint_connection( service_name: str, pe_connection_name: str, **kwargs - ) -> None: + ) -> 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. @@ -662,8 +655,8 @@ async def begin_delete_private_endpoint_connection( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -726,6 +719,10 @@ def list_private_endpoint_connections( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -739,15 +736,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -775,31 +768,20 @@ async def get_next(next_link=None): ) 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( + async def _check_private_link_service_visibility_initial( self, location: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "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.v2019_09_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + ) -> Optional["models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -815,7 +797,6 @@ async def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -824,47 +805,96 @@ async def check_private_link_service_visibility( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - async def check_private_link_service_visibility_by_resource_group( + async def begin_check_private_link_service_visibility( self, location: str, - resource_group_name: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": - """Checks whether the subscription is visible to private link service in the specified resource - group. + ) -> 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 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.v2019_09_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_09_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -881,7 +911,6 @@ async def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -890,17 +919,85 @@ async def check_private_link_service_visibility_by_resource_group( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_09_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.v2019_09_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -923,6 +1020,10 @@ def list_auto_approved_private_link_services( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -935,15 +1036,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -994,6 +1091,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1007,15 +1108,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_public_ip_addresses_operations_async.py index a40a8912f222..1d872720eece 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -543,6 +538,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -556,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -624,6 +619,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -640,15 +639,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -735,7 +730,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_public_ip_prefixes_operations_async.py index 0a991853d0ee..d069c254079f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_resource_navigation_links_operations_async.py index f1643ce6d2c4..a1f9bc17d7f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_filter_rules_operations_async.py index 91c83170f3be..0a7b6d5cb887 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list_by_route_filter( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_filters_operations_async.py index b47232a678bf..6191f10306c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -411,6 +406,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -423,15 +422,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -475,6 +470,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_tables_operations_async.py index 9262c2dedbd2..12d7fa335693 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -422,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_routes_operations_async.py index 3912c0b5f395..d595a2aaf10d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_security_rules_operations_async.py index 5c1397799e61..04b16a4019dd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_association_links_operations_async.py index c46dec7a4a10..e45c689f7fd2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_endpoint_policies_operations_async.py index fc4fe90850fa..ab8ccaa429b3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index 0180f42fe6fd..045adf23e92b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_tags_operations_async.py index db70c5e54c09..21b618af287e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_service_tags_operations_async.py @@ -77,7 +77,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_subnets_operations_async.py index eeeb1df041e6..42b961e8d2f0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -490,7 +485,6 @@ async def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -515,7 +509,7 @@ async def begin_unprepare_network_policies( subnet_name: str, unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -533,8 +527,8 @@ async def begin_unprepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -598,6 +592,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -611,15 +609,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_usages_operations_async.py index 0a95ce01b24c..eaa1161eda22 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py index 97459bdadc9b..f8792bb8606c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( route_table_name: str, virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: VirtualHubRouteTableV2, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualHubRouteTableV2 + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualHubRouteTableV2] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_hubs_operations_async.py index d8995c2b3edb..f59763df2ccb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualHub', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 396c88293dc3..0a05265a46fe 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -330,8 +326,8 @@ async def _update_tags_initial( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> Optional["models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -400,8 +395,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,7 +470,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -488,7 +482,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -507,7 +500,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -525,8 +518,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -610,7 +603,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -648,6 +640,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -660,15 +656,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -701,8 +693,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -726,7 +718,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -755,7 +746,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -774,8 +765,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -824,8 +815,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -849,7 +840,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -882,7 +872,7 @@ async def begin_start_packet_capture( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> 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. @@ -899,8 +889,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -949,8 +939,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -974,7 +964,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1004,7 +993,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> 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. @@ -1021,8 +1010,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 79f6d4d1e145..2285160f1432 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -326,8 +322,8 @@ async def _update_tags_initial( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,6 +524,10 @@ def list_connections( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -542,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -583,8 +578,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -608,7 +603,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -633,7 +627,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -649,8 +643,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -720,7 +714,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -739,7 +732,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -753,8 +746,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -799,8 +792,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -824,7 +817,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -853,7 +845,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -870,8 +862,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -920,8 +912,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -945,7 +937,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -974,7 +965,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -991,8 +982,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1040,8 +1031,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1063,7 +1054,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1101,8 +1091,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1150,8 +1140,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1175,7 +1165,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1200,7 +1189,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1215,8 +1204,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1298,7 +1287,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1320,8 +1308,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1343,7 +1331,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1367,7 +1354,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1381,8 +1368,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1430,8 +1417,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1454,7 +1441,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1479,7 +1465,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1495,8 +1481,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1545,8 +1531,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1570,7 +1556,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1599,7 +1584,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1616,8 +1601,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1688,7 +1673,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1710,7 +1694,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1725,8 +1709,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1797,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1840,8 +1823,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1865,7 +1848,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1898,7 +1880,7 @@ async def begin_start_packet_capture( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -1914,8 +1896,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1964,8 +1946,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1989,7 +1971,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2019,7 +2000,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2035,8 +2016,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -2084,8 +2065,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientConnectionHealthDetailListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -2107,7 +2088,6 @@ async def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -2131,7 +2111,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -2145,8 +2125,8 @@ async def begin_get_vpnclient_connection_health( 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: VpnClientConnectionHealthDetailListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnClientConnectionHealthDetailListResult + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnClientConnectionHealthDetailListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 4cb3ff008976..c401987f2de5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_taps_operations_async.py index 6fa3aeefc4fd..735c4632ff0e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_networks_operations_async.py index a00995ca21a2..9b98968588e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -563,7 +558,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -603,6 +597,10 @@ def list_usage( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -616,15 +614,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_router_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_router_peerings_operations_async.py index 1a06cac8b9c0..659a50ac8436 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_router_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_router_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -93,7 +92,7 @@ async def begin_delete( virtual_router_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -192,7 +191,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -257,7 +254,6 @@ async def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -277,7 +273,7 @@ async def begin_create_or_update( peering_name: str, parameters: "models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": + ) -> AsyncLROPoller["models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_create_or_update( 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: VirtualRouterPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualRouterPeering + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualRouterPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,6 +359,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_routers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_routers_operations_async.py index 73511b471bd5..6e7c07bb5822 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_routers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_routers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( virtual_router_name: str, parameters: "models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": + ) -> AsyncLROPoller["models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: VirtualRouter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualRouter + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualRouter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_wans_operations_async.py index 62e704984da0..b4ee44da40c7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualWAN', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_connections_operations_async.py index 259e77e882ae..944d4ed851df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -136,7 +135,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnConnection', pipeline_response) @@ -169,7 +166,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -187,8 +184,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -261,7 +258,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -281,7 +277,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -296,8 +292,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,6 +356,10 @@ def list_by_vpn_gateway( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_gateways_operations_async.py index 7207d75d1fe8..ba48c1e46cd4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -266,7 +263,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -314,7 +310,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +328,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -346,8 +341,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -391,8 +386,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> Optional["models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -414,7 +409,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -438,7 +432,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> "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. @@ -451,8 +445,8 @@ async def begin_reset( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -514,6 +508,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -526,15 +524,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -578,6 +572,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_link_connections_operations_async.py index 528b997b3fbf..4f87cd8e3eb9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -68,6 +68,10 @@ def list_by_vpn_connection( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py index 06e731528da6..8218b84073ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VpnServerConfigurationsResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + ) -> Optional["models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -70,7 +70,6 @@ async def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "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. @@ -108,8 +107,8 @@ async def begin_list( 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: VpnServerConfigurationsResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnServerConfigurationsResponse + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationsResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnServerConfigurationsResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_server_configurations_operations_async.py index 8ad6aedd81f9..dcdad13e7b53 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_server_configurations_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_server_configuration_name: str, vpn_server_configuration_parameters: "models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> AsyncLROPoller["models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -269,7 +266,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -317,7 +313,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -336,7 +331,7 @@ async def begin_delete( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -349,8 +344,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -409,6 +404,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -484,15 +483,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_site_link_connections_operations_async.py index 61137a075cad..9d6f8fc3a2a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_site_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_site_link_connections_operations_async.py @@ -87,7 +87,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_site_links_operations_async.py index 2f70b1355691..771de8580a8a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_site_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list_by_vpn_site( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 5e6abeafbcfb..916ce3d4ad21 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -96,7 +95,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -112,8 +111,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_sites_operations_async.py index 19e663d328f7..0bd45e6112cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnSite', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_09_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index f9b9645e19b7..c96bdac17a39 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] 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 864ff9a1cbf8..4b1179e6b3c9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -555,7 +550,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -575,7 +569,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -656,7 +650,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +669,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -736,8 +729,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -761,7 +754,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -787,7 +779,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -854,8 +846,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -881,7 +873,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -912,7 +903,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1007,7 +998,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,7 +1047,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1107,7 +1096,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1157,7 +1145,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1206,7 +1193,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1241,6 +1227,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1252,15 +1242,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1323,7 +1309,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e2affeb31ec7..527283d582ff 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -375,7 +371,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -414,6 +409,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -425,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -493,15 +492,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2352f6deac9c..095f72cfcf6b 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 18f5d135a7ec..8571b15750a6 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9150d146884c..702291d94344 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 @@ -67,6 +67,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,6 +139,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -152,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 60f17636d707..39166db6dbed 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 371dc2ea3a58..30bfb262e216 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -137,6 +137,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -150,15 +154,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a6b79f4059c3..af6df49a7900 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 06da20b81197..8802ee6d750d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> Optional["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -536,6 +531,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -547,15 +546,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 df45067a3b2c..500c32e14f9f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('BastionHost', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 de91fba52077..8e048a0014f5 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9e0630c0c909..c3cffc86abc7 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -397,7 +393,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -449,7 +444,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -471,7 +465,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -557,7 +551,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -579,7 +572,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -666,7 +659,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +668,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -696,7 +687,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -779,6 +770,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -792,15 +787,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7a484a4c1b13..10d341e3b449 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -373,7 +369,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content 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 2ee28bb6143f..d04e11a6c44a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 65f4aa9bc540..9cdc8b388fef 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5c4690c7adba..8026516f6fa9 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b6175ece74ca..a753242584ee 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2ee85d11c107..d12c55966412 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b68fd09335e4..95a2c4ae4640 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,8 +398,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -428,7 +423,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +449,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -526,8 +520,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -551,7 +545,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -578,7 +571,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -649,8 +642,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -674,7 +667,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -701,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -804,7 +796,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -865,7 +856,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -903,6 +893,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -915,15 +909,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -968,6 +958,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -979,15 +973,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4cb97670c017..0440d35e5104 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 80b967e81586..e93e300d3781 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 1827bcce28a9..beee4288000d 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -402,7 +400,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -431,8 +428,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -456,7 +453,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,7 +479,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -554,8 +550,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -579,7 +575,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -606,7 +601,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -677,8 +672,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -702,7 +697,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +723,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 6bd0116992d6..97e1ed85336a 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 13849fba500a..9f2ec4e09523 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 29d858612db2..bedbebbfa257 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 cd20d1c805a0..c5a316b8be5e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 74aee33eae5c..330168c147cc 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8687f225335c..0e3ba20af747 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('FirewallPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -355,6 +351,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f7e9ffd6520a..12fcf877f899 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4ad2f0871345..7d087b669652 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5669a5f5b5c3..6c8c09826e25 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 b684a649c27e..41bbc415e04b 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 @@ -93,7 +93,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -177,7 +174,7 @@ def begin_create_or_update( parameters, # type: "models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -281,7 +278,6 @@ def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -331,7 +327,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -352,7 +347,7 @@ def begin_delete( ip_groups_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -426,6 +421,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -438,15 +437,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -492,6 +487,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -503,15 +502,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 61d13249251f..0cd74b08719f 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e95863487e21..24539130ce22 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 46063b49f0fc..a2c16d0572d2 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 63140cc41e88..704acd2ed5d9 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 96c548513953..711b5db2ce63 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 931bf9edf7d1..eb53b784c48a 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 dff0b0493bcb..a65776ddf5b9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f1be4d31adeb..b08209cb2b37 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4253849b07f5..4d7eb2497f3f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5f7e12551664..5e8fddd9a2a9 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a5c4e2a27668..ae165219e652 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 62457d31a71a..cee335ade15f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3466d4cc4cce..57c8206d1957 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,8 +533,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -561,7 +556,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -586,7 +580,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -648,8 +642,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -671,7 +665,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -696,7 +689,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -780,6 +773,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -794,15 +791,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -853,6 +846,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -866,15 +863,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -954,7 +947,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1004,6 +996,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1021,15 +1017,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1113,7 +1105,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ee6b70a39d8b..8c0e8a865180 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 @@ -34,8 +34,8 @@ def _put_bastion_shareable_link_initial( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> "models.BastionShareableLinkListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + # type: (...) -> Optional["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -59,7 +59,6 @@ def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -89,7 +88,7 @@ def begin_put_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["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. @@ -179,7 +178,6 @@ def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -204,7 +202,7 @@ def begin_delete_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -288,6 +286,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -301,19 +304,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -347,8 +349,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionActiveSessionListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + # type: (...) -> Optional["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -370,7 +372,6 @@ def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +396,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionActiveSessionListResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -479,6 +480,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -492,19 +498,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -573,7 +578,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +635,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -655,8 +658,8 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -680,7 +683,6 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -710,7 +712,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. 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 422171cf6a9f..1ab48e0e5149 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9cee35b00be9..bc4a2bf442d8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 23d0e0851863..052668af4ad9 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureReachabilityReport"] """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1707,7 +1683,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1721,7 +1696,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1741,7 +1715,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1832,7 +1806,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1846,7 +1819,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1866,7 +1838,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 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 10da1d2525ac..9f7b3d3075c1 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 82da8d9363a2..48f4873a0483 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -275,7 +272,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -324,7 +320,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -344,7 +339,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,6 +413,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -483,6 +478,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -494,15 +493,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -536,8 +531,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -561,7 +556,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -591,7 +585,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -657,8 +651,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> Optional["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -680,7 +674,6 @@ def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -705,7 +698,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -769,8 +762,8 @@ def _get_p2_s_vpn_connection_health_detailed_initial( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnConnectionHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + # type: (...) -> Optional["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -794,7 +787,6 @@ def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -824,7 +816,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 606194f2081c..e23ff780a305 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4cf5f130a39c..1693dd3cd0e3 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b90cf47c517a..456960b0fa86 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( private_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d35a2bf5f31e..a62fd4f63eb9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -521,7 +517,6 @@ def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -588,7 +583,6 @@ def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -640,7 +634,6 @@ def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -662,7 +655,7 @@ def begin_delete_private_endpoint_connection( pe_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -742,6 +735,10 @@ def list_private_endpoint_connections( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -755,15 +752,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -791,32 +784,21 @@ def get_next(next_link=None): ) list_private_endpoint_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections'} # type: ignore - def check_private_link_service_visibility( + def _check_private_link_service_visibility_initial( self, location, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "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.v2019_09_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -832,7 +814,6 @@ def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -841,48 +822,98 @@ def check_private_link_service_visibility( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - def check_private_link_service_visibility_by_resource_group( + def begin_check_private_link_service_visibility( self, location, # type: str - resource_group_name, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" - """Checks whether the subscription is visible to private link service in the specified resource - group. + # 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 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.v2019_09_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_09_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_09_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -899,7 +930,6 @@ def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -908,17 +938,86 @@ def check_private_link_service_visibility_by_resource_group( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_09_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.v2019_09_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -942,6 +1041,10 @@ def list_auto_approved_private_link_services( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -954,15 +1057,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1014,6 +1113,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1027,15 +1130,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4a77fe22688e..afcd7373547f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -556,6 +551,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -569,15 +568,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -638,6 +633,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -654,15 +653,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -750,7 +745,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 38cfe2a3f936..d95d0f2b1868 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 753fb1d44017..9a3880c0284d 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a229af9b5b83..56122ba94469 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list_by_route_filter( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 82be1b62eade..1ccd499fee28 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -422,6 +417,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -434,15 +433,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -487,6 +482,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e85cd1c2853f..8ef76bef9997 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bb8cfecc9416..2a6b627e8d35 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f3967e7cff12..8dbeb40b3a33 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b62124d01a93..988813f941f4 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 f9e8287e953b..e353241f36c9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 04d2523db613..05ac0df588ff 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bce1253406bb..1ceac0cbf9d2 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 @@ -82,7 +82,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 9ecbd6edcc8b..d3c59b0dd328 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -502,7 +497,6 @@ def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -528,7 +522,7 @@ def begin_unprepare_network_policies( unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -612,6 +606,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -625,15 +623,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a7330f2d9bb7..0e48b859ee92 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 67f21df4e3c8..01e312dca987 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -374,6 +370,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 be5929968f71..7f3aa5c75254 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualHub', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 09d70f24ffd0..4c91c810d5d3 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -340,8 +336,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -487,7 +482,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -500,7 +494,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -520,7 +513,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -624,7 +617,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,6 +655,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -675,15 +671,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -717,8 +709,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -742,7 +734,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -772,7 +763,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -842,8 +833,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -867,7 +858,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -901,7 +891,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -969,8 +959,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -994,7 +984,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1025,7 +1014,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 46274be5c958..850844592a5e 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,6 +537,10 @@ def list_connections( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -555,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -597,8 +592,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -622,7 +617,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -648,7 +642,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -736,7 +730,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -756,7 +749,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -817,8 +810,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -842,7 +835,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -940,8 +932,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -965,7 +957,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -995,7 +986,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1062,8 +1053,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1085,7 +1076,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1174,8 +1164,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1199,7 +1189,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1225,7 +1214,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1324,7 +1313,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1347,8 +1335,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1370,7 +1358,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1395,7 +1382,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1459,8 +1446,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1483,7 +1470,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1509,7 +1495,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1576,8 +1562,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1601,7 +1587,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1631,7 +1616,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1721,7 +1706,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1744,7 +1728,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1848,7 +1832,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1876,8 +1859,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -1901,7 +1884,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1935,7 +1917,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2002,8 +1984,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -2027,7 +2009,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2058,7 +2039,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2124,8 +2105,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientConnectionHealthDetailListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -2147,7 +2128,6 @@ def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2172,7 +2152,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. 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 0b8fc5c0a948..51a071b759e8 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b083bdf95b86..019d6556a2b9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f2ec75855fe2..8ea48395184a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -576,7 +571,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -617,6 +611,10 @@ def list_usage( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -630,15 +628,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 abfdbde6ee43..f2e5a97ee3b7 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +98,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -199,7 +198,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -265,7 +262,6 @@ def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -286,7 +282,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -373,6 +369,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d2b208391739..8dd4ab5f6740 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -358,6 +354,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 81bc2c0f760c..dcb4ed47a3fd 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualWAN', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3e0b17c88fac..2fe00721323b 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -142,7 +141,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -155,7 +153,6 @@ 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('VpnConnection', pipeline_response) @@ -176,7 +173,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -269,7 +266,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -290,7 +286,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -370,6 +366,10 @@ def list_by_vpn_gateway( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e06576cddf02..dc8eed6959f0 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -274,7 +271,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -323,7 +319,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +338,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -402,8 +397,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> Optional["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -425,7 +420,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -450,7 +444,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -527,6 +521,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -539,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -592,6 +586,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f1c7ab092f97..53f95e8202ac 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 @@ -73,6 +73,10 @@ def list_by_vpn_connection( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -87,15 +91,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 def1c6092249..f07a5e46de68 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 @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfigurationsResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-09-01" @@ -75,7 +75,6 @@ def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 f780f8944bad..8226ca39ffd3 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -277,7 +274,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -326,7 +322,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -346,7 +341,7 @@ def begin_delete( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,6 +415,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -496,15 +495,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f4062d6df268..b9289393c11f 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 @@ -92,7 +92,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e67bbdf2ab4c..deb3db2e4b08 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list_by_vpn_site( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9a1f974e483a..f581a03346c8 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -102,7 +101,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 ad64b15781a9..c11f0e8739c9 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnSite', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 df96f59c7d30..a0f5339b1c60 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 @@ -68,6 +68,10 @@ def list( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2019-09-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 dfc30dfd75e4..45f02e4d74c0 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 @@ -137,51 +137,43 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "operation_name": "_put_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_put_bastion_shareable_link_initial", - "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 \"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", "coroutine": true }, "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" }, - "put_bastion_shareable_link" : { + "begin_put_bastion_shareable_link" : { "sync": { - "operation_name": "begin_put_bastion_shareable_link", "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" }, "async": { - "operation_name": "put_bastion_shareable_link", - "signature": "async def 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 \"models.BastionShareableLinkListResult\":\n", + "signature": "async 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[\"models.BastionShareableLinkListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "_delete_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_delete_bastion_shareable_link_initial", "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", "coroutine": true }, "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" }, - "delete_bastion_shareable_link" : { + "begin_delete_bastion_shareable_link" : { "sync": { - "operation_name": "begin_delete_bastion_shareable_link", "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" }, "async": { - "operation_name": "delete_bastion_shareable_link", - "signature": "async def 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 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", "coroutine": true }, "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:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", @@ -189,11 +181,9 @@ }, "get_bastion_shareable_link" : { "sync": { - "operation_name": "get_bastion_shareable_link", "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" }, "async": { - "operation_name": "get_bastion_shareable_link", "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", "coroutine": false }, @@ -202,37 +192,31 @@ }, "_get_active_sessions_initial" : { "sync": { - "operation_name": "_get_active_sessions_initial", "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" }, "async": { - "operation_name": "_get_active_sessions_initial", - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"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", "coroutine": true }, "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" }, - "get_active_sessions" : { + "begin_get_active_sessions" : { "sync": { - "operation_name": "begin_get_active_sessions", "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" }, "async": { - "operation_name": "get_active_sessions", - "signature": "async def get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"models.BastionActiveSessionListResult\":\n", + "signature": "async def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.BastionActiveSessionListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "disconnect_active_sessions", "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" }, "async": { - "operation_name": "disconnect_active_sessions", "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", "coroutine": false }, @@ -241,11 +225,9 @@ }, "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -254,11 +236,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -267,31 +247,27 @@ }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", "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" }, "async": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", - "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 \"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", "coroutine": true }, "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" }, - "generatevirtualwanvpnserverconfigurationvpnprofile" : { + "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "operation_name": "begin_generatevirtualwanvpnserverconfigurationvpnprofile", "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" }, "async": { - "operation_name": "generatevirtualwanvpnserverconfigurationvpnprofile", - "signature": "async def generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e \"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", "coroutine": true }, - "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: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\"\"\"", + "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:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~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" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.paging import ItemPaged\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.arm_polling import ARMPolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union", - "async_imports": "from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.async_paging import AsyncItemPaged, AsyncList\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"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\": [\"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/v2019_11_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_application_gateways_operations_async.py index 2f7ce95993dc..9e7569953230 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -542,7 +537,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -561,7 +555,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -574,8 +568,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -641,7 +635,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -660,7 +653,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -673,8 +666,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -719,8 +712,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -744,7 +737,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -769,7 +761,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -784,8 +776,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -835,8 +827,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -862,7 +854,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -892,7 +883,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -910,8 +901,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -986,7 +977,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1035,7 +1025,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1084,7 +1073,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1133,7 +1121,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1181,7 +1168,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1215,6 +1201,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1226,15 +1216,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1296,7 +1282,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_application_security_groups_operations_async.py index 5df40f561b4e..05d6628fa809 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -365,7 +361,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,6 +398,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -414,15 +413,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_delegations_operations_async.py index 4f2d46b0b4de..67482e54b7f8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_endpoint_services_operations_async.py index 204aa192b13d..3429f8f37dac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_private_endpoint_types_operations_async.py index a22ad590f95b..ea096916ee8e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_private_endpoint_types_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -62,6 +62,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -146,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index de322b33c996..77be930c8bfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_service_aliases_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_service_aliases_operations_async.py index 041f9c8bd23d..0858bc4789d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_service_aliases_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_available_service_aliases_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -131,6 +131,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 15e4e817de96..e6faf3fd87e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_azure_firewalls_operations_async.py index 76768a4de91d..068fba60fb4a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_bastion_hosts_operations_async.py index bc33ad8765eb..3368c683fbd9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_bastion_hosts_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('BastionHost', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( bastion_host_name: str, parameters: "models.BastionHost", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_bgp_service_communities_operations_async.py index 11ee027710fe..8e12e19b253e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_connection_monitors_operations_async.py index c827226f5be9..a3c072389045 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -387,7 +383,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -438,7 +433,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -459,7 +453,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -474,8 +468,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -544,7 +538,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -565,7 +558,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -580,8 +573,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -651,7 +644,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -661,7 +653,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -680,7 +671,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -695,8 +686,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -762,6 +753,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -775,15 +770,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ddos_custom_policies_operations_async.py index d8438cfed0ff..6a4706cf08f3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,7 +359,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ddos_protection_plans_operations_async.py index ff7cbc989caf..b014d6959179 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_default_security_rules_operations_async.py index 34cc8550a773..322c46becec8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index cd184aa0405a..fc60a59de8e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index f0b01b5de4d5..58ffb74525a4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 19a025334a6f..0df0f996d458 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuits_operations_async.py index 827070495b2d..accef053b5ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -392,8 +387,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -417,7 +412,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -443,7 +437,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -461,8 +455,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -513,8 +507,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -538,7 +532,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -564,7 +557,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -582,8 +575,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -634,8 +627,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -659,7 +652,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -685,7 +677,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -703,8 +695,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -787,7 +779,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -847,7 +838,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -884,6 +874,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -896,15 +890,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -948,6 +938,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -959,15 +953,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_connections_operations_async.py index e6190a29187b..a4038c0dc648 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index be41d61317ef..82e9fbc5e177 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 6cf0a0c7dc14..9d7b9ae3266c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -392,7 +390,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -420,8 +417,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -445,7 +442,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -471,7 +467,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -489,8 +485,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -541,8 +537,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -566,7 +562,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -592,7 +587,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -610,8 +605,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -662,8 +657,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -687,7 +682,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -713,7 +707,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -731,8 +725,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_gateways_operations_async.py index d4bb1758c29a..4dcd2ae8a0ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_links_operations_async.py index 8bb93cb63ac4..81c4d2047589 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_ports_locations_operations_async.py index 217f02e0c0f5..43024d60beb0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_ports_operations_async.py index de06353147a2..4810aa39e87b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_service_providers_operations_async.py index 6ba147b89bb8..edb585e194ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_firewall_policies_operations_async.py index b3aee26d17bb..e53bea86ca68 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_firewall_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('FirewallPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( firewall_policy_name: str, parameters: "models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": + ) -> AsyncLROPoller["models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: FirewallPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.FirewallPolicy + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.FirewallPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py index 56736eea166b..7d59c0347237 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_group_name: str, parameters: "models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: FirewallPolicyRuleGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.FirewallPolicyRuleGroup + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.FirewallPolicyRuleGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_flow_logs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_flow_logs_operations_async.py index 108e4e38447a..47b3b8108922 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_flow_logs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_flow_logs_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLog') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLog', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( flow_log_name: str, parameters: "models.FlowLog", **kwargs - ) -> "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. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: FlowLog, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.FlowLog + :return: An instance of AsyncLROPoller that returns either FlowLog or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.FlowLog] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified flow log resource. :param resource_group_name: The name of the resource group. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -362,6 +358,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 6527e8853a67..89c90c676dfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py index a115d4a9941a..aae59517e703 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ip_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ip_groups_operations_async.py index f322c749d8e0..ffe685e7da65 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ip_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_ip_groups_operations_async.py @@ -88,7 +88,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -170,7 +167,7 @@ async def begin_create_or_update( ip_groups_name: str, parameters: "models.IpGroup", **kwargs - ) -> "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. @@ -185,8 +182,8 @@ async def begin_create_or_update( 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: IpGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.IpGroup + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.IpGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -273,7 +270,6 @@ async def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -342,7 +337,7 @@ async def begin_delete( resource_group_name: str, ip_groups_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -355,8 +350,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -415,6 +410,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -427,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -491,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 01e175e11bf9..650613ac9819 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 719b9a3bb938..19055b927b09 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index a49102f0e072..5a6222e17f1e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index ace01d462613..802d2d7d7219 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 0846fc7bc007..e5dcf76056d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_probes_operations_async.py index d07ddd2d3c8e..7126508e0446 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancers_operations_async.py index e55e9075c157..ea819b8c060b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_local_network_gateways_operations_async.py index d002ba61f783..aca5aebc6814 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_nat_gateways_operations_async.py index df303bc21028..2387f0d90dc4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 0861adbb9c42..d35033097407 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index b7cbdf980f6f..620dced46c1c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 97335b622bb7..311a1026a193 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interfaces_operations_async.py index bda47952be2a..fd8256de495c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,8 +520,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -548,7 +543,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -572,7 +566,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -585,8 +579,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -633,8 +627,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -656,7 +650,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -680,7 +673,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -693,8 +686,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -763,6 +756,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -777,15 +774,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -835,6 +828,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -848,15 +845,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -935,7 +928,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -984,6 +976,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1001,15 +997,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1092,7 +1084,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_management_client_operations_async.py index b7c16aa48e84..ad50f5614b33 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_management_client_operations_async.py @@ -29,8 +29,8 @@ async def _put_bastion_shareable_link_initial( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + ) -> Optional["models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -54,7 +54,6 @@ async def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -83,7 +82,7 @@ async def begin_put_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": + ) -> AsyncLROPoller["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. @@ -98,8 +97,8 @@ async def begin_put_bastion_shareable_link( 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: BastionShareableLinkListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult + :return: An instance of AsyncLROPoller that returns either BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.BastionShareableLinkListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -172,7 +171,6 @@ async def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -196,7 +194,7 @@ async def begin_delete_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> None: + ) -> 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. @@ -211,8 +209,8 @@ async def begin_delete_bastion_shareable_link( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -279,6 +277,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -292,19 +295,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -337,8 +339,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + ) -> Optional["models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -360,7 +362,6 @@ async def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -384,7 +385,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": + ) -> AsyncLROPoller["models.BastionActiveSessionListResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -397,8 +398,8 @@ async def begin_get_active_sessions( 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: BastionActiveSessionListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.BastionActiveSessionListResult + :return: An instance of AsyncLROPoller that returns either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.BastionActiveSessionListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -467,6 +468,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -480,19 +486,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -560,7 +565,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -617,7 +621,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -640,8 +643,8 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -665,7 +668,6 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -694,7 +696,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": + ) -> AsyncLROPoller["models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -712,8 +714,8 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_profiles_operations_async.py index 17b00204b216..c60de61b0b7e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_security_groups_operations_async.py index 1eecab99511a..05b968307c87 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_watchers_operations_async.py index 0492b4184180..8caf496ed300 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "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. @@ -1602,8 +1578,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1677,7 +1653,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1691,7 +1666,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1710,7 +1684,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1726,8 +1700,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1801,7 +1775,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1815,7 +1788,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1834,7 +1806,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "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 @@ -1853,8 +1825,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_operations_async.py index b1497153be36..9cafa8cdca64 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index a59e6ba41c1c..141506fb7648 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -267,7 +264,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -315,7 +311,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -334,7 +329,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -347,8 +342,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,6 +402,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -471,6 +466,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -523,8 +518,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -548,7 +543,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -577,7 +571,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -593,8 +587,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -642,8 +636,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> Optional["models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -665,7 +659,6 @@ async def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -689,7 +682,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -703,8 +696,8 @@ async def begin_get_p2_s_vpn_connection_health( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -752,8 +745,8 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "models.P2SVpnConnectionHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + ) -> Optional["models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -777,7 +770,6 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -806,7 +798,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "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. @@ -822,8 +814,8 @@ async def begin_get_p2_s_vpn_connection_health_detailed( 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: P2SVpnConnectionHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.P2SVpnConnectionHealth + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.P2SVpnConnectionHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -896,7 +888,6 @@ async def _disconnect_p2_s_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -920,7 +911,7 @@ async def begin_disconnect_p2_s_vpn_connections( p2_s_vpn_gateway_name: str, request: "models.P2SVpnConnectionRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. @@ -936,8 +927,8 @@ async def begin_disconnect_p2_s_vpn_connections( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_packet_captures_operations_async.py index b5b2abc9f422..d75ee767e6fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index 63d51de77aca..04e54b17e621 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_private_endpoints_operations_async.py index b0f204bda991..3ce30853230a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_private_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_private_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, private_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( private_endpoint_name: str, parameters: "models.PrivateEndpoint", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateEndpoint + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.PrivateEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_private_link_services_operations_async.py index 2293861a2313..b7f8401b3550 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_private_link_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_private_link_services_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, service_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( service_name: str, parameters: "models.PrivateLinkService", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateLinkService, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateLinkService + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.PrivateLinkService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -509,7 +505,6 @@ async def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -575,7 +570,6 @@ async def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -626,7 +620,6 @@ async def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -647,7 +640,7 @@ async def begin_delete_private_endpoint_connection( service_name: str, pe_connection_name: str, **kwargs - ) -> None: + ) -> 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. @@ -662,8 +655,8 @@ async def begin_delete_private_endpoint_connection( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -726,6 +719,10 @@ def list_private_endpoint_connections( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -739,15 +736,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -775,31 +768,20 @@ async def get_next(next_link=None): ) 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( + async def _check_private_link_service_visibility_initial( self, location: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "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.v2019_11_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + ) -> Optional["models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -815,7 +797,6 @@ async def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -824,47 +805,96 @@ async def check_private_link_service_visibility( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - async def check_private_link_service_visibility_by_resource_group( + async def begin_check_private_link_service_visibility( self, location: str, - resource_group_name: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": - """Checks whether the subscription is visible to private link service in the specified resource - group. + ) -> 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 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.v2019_11_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_11_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -881,7 +911,6 @@ async def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -890,17 +919,85 @@ async def check_private_link_service_visibility_by_resource_group( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_11_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.v2019_11_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -923,6 +1020,10 @@ def list_auto_approved_private_link_services( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -935,15 +1036,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -994,6 +1091,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1007,15 +1108,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_public_ip_addresses_operations_async.py index df7f9c096403..75e8fd18b8cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -543,6 +538,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -556,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -624,6 +619,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -640,15 +639,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -735,7 +730,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_public_ip_prefixes_operations_async.py index 90d28969862e..a85aca540e2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_resource_navigation_links_operations_async.py index 1eda2e4974a4..56fe460078e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_filter_rules_operations_async.py index 8ba5817a643f..d39b65ba99d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list_by_route_filter( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_filters_operations_async.py index 667fbf8c398d..8fa3566dbb11 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -411,6 +406,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -423,15 +422,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -475,6 +470,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_tables_operations_async.py index 11ea9a296e6d..a9a69dae4a21 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -422,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_routes_operations_async.py index fcf567ff6b93..bff4abb9a0df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_security_rules_operations_async.py index 4d657e8cb59c..72437af74ef2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_association_links_operations_async.py index 5af088bdd0ae..f53a61c9eb9a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_endpoint_policies_operations_async.py index 326b60533677..4690018a363f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index a96825851d6b..0a121fe3151a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_tags_operations_async.py index b54211ea1c55..20cd162ecec1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_service_tags_operations_async.py @@ -77,7 +77,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_subnets_operations_async.py index 024257703d69..b055135796db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -490,7 +485,6 @@ async def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -515,7 +509,7 @@ async def begin_unprepare_network_policies( subnet_name: str, unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -533,8 +527,8 @@ async def begin_unprepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -598,6 +592,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -611,15 +609,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_usages_operations_async.py index dd59b307d2e3..66ac8267b5f3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py index 33fd318a327d..dca8b0f8e229 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( route_table_name: str, virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: VirtualHubRouteTableV2, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualHubRouteTableV2 + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualHubRouteTableV2] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_hubs_operations_async.py index 60bb6666e2c0..1136b841b5c3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualHub', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 081537f998f4..1d90ae1894c2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -330,8 +326,8 @@ async def _update_tags_initial( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> Optional["models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -400,8 +395,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,7 +470,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -488,7 +482,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -507,7 +500,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -525,8 +518,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -610,7 +603,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -648,6 +640,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -660,15 +656,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -701,8 +693,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -726,7 +718,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -755,7 +746,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -774,8 +765,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -824,8 +815,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -849,7 +840,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -882,7 +872,7 @@ async def begin_start_packet_capture( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> 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. @@ -899,8 +889,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -949,8 +939,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -974,7 +964,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1004,7 +993,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> 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. @@ -1021,8 +1010,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py index d25ece324b31..3b9d27db4f0b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -326,8 +322,8 @@ async def _update_tags_initial( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,6 +524,10 @@ def list_connections( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -542,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -583,8 +578,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -608,7 +603,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -633,7 +627,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -649,8 +643,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -720,7 +714,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -739,7 +732,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -753,8 +746,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -799,8 +792,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -824,7 +817,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -853,7 +845,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -870,8 +862,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -920,8 +912,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -945,7 +937,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -974,7 +965,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -991,8 +982,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1040,8 +1031,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1063,7 +1054,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1101,8 +1091,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1150,8 +1140,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1175,7 +1165,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1200,7 +1189,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1215,8 +1204,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1298,7 +1287,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1320,8 +1308,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1343,7 +1331,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1367,7 +1354,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1381,8 +1368,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1430,8 +1417,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1454,7 +1441,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1479,7 +1465,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1495,8 +1481,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1545,8 +1531,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1570,7 +1556,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1599,7 +1584,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1616,8 +1601,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1688,7 +1673,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1710,7 +1694,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1725,8 +1709,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1797,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1840,8 +1823,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1865,7 +1848,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1898,7 +1880,7 @@ async def begin_start_packet_capture( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -1914,8 +1896,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1964,8 +1946,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1989,7 +1971,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2019,7 +2000,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2035,8 +2016,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -2084,8 +2065,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientConnectionHealthDetailListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -2107,7 +2088,6 @@ async def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -2131,7 +2111,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -2145,8 +2125,8 @@ async def begin_get_vpnclient_connection_health( 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: VpnClientConnectionHealthDetailListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnClientConnectionHealthDetailListResult + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnClientConnectionHealthDetailListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2218,7 +2198,6 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -2242,7 +2221,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( virtual_network_gateway_name: str, request: "models.P2SVpnConnectionRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2257,8 +2236,8 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py index f04f2212e8fe..2b465e4ebed0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_taps_operations_async.py index 2b26deda11ae..8f9dcb45d50b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_networks_operations_async.py index 8565e76b5c75..c5c66779f872 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -563,7 +558,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -603,6 +597,10 @@ def list_usage( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -616,15 +614,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_router_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_router_peerings_operations_async.py index 50b4eb6e4e45..5e019e570e1a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_router_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_router_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -93,7 +92,7 @@ async def begin_delete( virtual_router_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -192,7 +191,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -257,7 +254,6 @@ async def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -277,7 +273,7 @@ async def begin_create_or_update( peering_name: str, parameters: "models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": + ) -> AsyncLROPoller["models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_create_or_update( 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: VirtualRouterPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualRouterPeering + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualRouterPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,6 +359,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_routers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_routers_operations_async.py index 2b5407048653..5923f4833b1a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_routers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_routers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( virtual_router_name: str, parameters: "models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": + ) -> AsyncLROPoller["models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: VirtualRouter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualRouter + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualRouter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_wans_operations_async.py index 03d4b816eba8..d97d6d00ce48 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualWAN', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_connections_operations_async.py index 2a5fad199184..be4da401e349 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -136,7 +135,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnConnection', pipeline_response) @@ -169,7 +166,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -187,8 +184,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -261,7 +258,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -281,7 +277,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -296,8 +292,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,6 +356,10 @@ def list_by_vpn_gateway( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_gateways_operations_async.py index d7a7fa96d7a4..d30bb739156c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -266,7 +263,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -314,7 +310,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +328,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -346,8 +341,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -391,8 +386,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> Optional["models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -414,7 +409,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -438,7 +432,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> "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. @@ -451,8 +445,8 @@ async def begin_reset( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -514,6 +508,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -526,15 +524,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -578,6 +572,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_link_connections_operations_async.py index 0af55e786880..f518a3da5717 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -68,6 +68,10 @@ def list_by_vpn_connection( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py index 2a785285d237..2e8573390715 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VpnServerConfigurationsResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + ) -> Optional["models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -70,7 +70,6 @@ async def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "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. @@ -108,8 +107,8 @@ async def begin_list( 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: VpnServerConfigurationsResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnServerConfigurationsResponse + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationsResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnServerConfigurationsResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_server_configurations_operations_async.py index 908e30f8a839..d072f0a3ed42 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_server_configurations_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_server_configuration_name: str, vpn_server_configuration_parameters: "models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> AsyncLROPoller["models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -269,7 +266,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -317,7 +313,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -336,7 +331,7 @@ async def begin_delete( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -349,8 +344,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -409,6 +404,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -484,15 +483,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_site_link_connections_operations_async.py index d8c92e13ee70..52473965fc2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_site_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_site_link_connections_operations_async.py @@ -87,7 +87,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_site_links_operations_async.py index 1cb3f8e87b32..b657f7878147 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_site_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list_by_vpn_site( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index b7769769e4a5..7334ca98673f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -96,7 +95,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -112,8 +111,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_sites_operations_async.py index e8fc5d7638c8..33a3c26170cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnSite', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_11_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index 986270859c78..07d3a5c728ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] 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 e92ca2c114bc..792c279e4bb0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -555,7 +550,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -575,7 +569,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -656,7 +650,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +669,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -736,8 +729,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -761,7 +754,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -787,7 +779,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -854,8 +846,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -881,7 +873,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -912,7 +903,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1007,7 +998,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,7 +1047,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1107,7 +1096,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1157,7 +1145,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1206,7 +1193,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1241,6 +1227,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1252,15 +1242,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1323,7 +1309,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 eafc785d1606..554b050318c8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -375,7 +371,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -414,6 +409,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -425,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -493,15 +492,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 39cf3e9cff2d..22c35eeacf34 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b940605a099f..6dd007108cd2 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1e23c7261876..2bbda0969617 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 @@ -67,6 +67,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,6 +139,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -152,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4819b728218f..0f8ed9cdc04a 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 901558e03bf2..d39143026034 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -137,6 +137,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -150,15 +154,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 06c01a056d5b..2fbabcc0fc7a 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 373828557fc6..edac75244abb 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3b663d0846b2..5e2e640b1a22 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('BastionHost', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0c4c66f3b71a..0cfac5e523e4 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 06c5fc50a73b..5aa89dcf208c 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -397,7 +393,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -449,7 +444,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -471,7 +465,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -557,7 +551,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -579,7 +572,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -666,7 +659,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +668,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -696,7 +687,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -779,6 +770,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -792,15 +787,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 508e7b10c5b0..7643b06a3cd4 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -373,7 +369,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content 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 4b60a7ed2125..9c5bf5101ff2 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a09e0e3d9367..f680102217d5 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 437196c8d290..53f1d516fee1 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8719e9df42a1..1021c16b6f7a 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aa48cad06063..75084068e966 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a6f825e85fae..2af7c56a1fed 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,8 +398,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -428,7 +423,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +449,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -526,8 +520,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -551,7 +545,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -578,7 +571,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -649,8 +642,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -674,7 +667,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -701,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -804,7 +796,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -865,7 +856,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -903,6 +893,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -915,15 +909,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -968,6 +958,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -979,15 +973,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 217ef19dab72..2ca9748c1a53 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d2c44aeea4d9..dd21d9c7ecca 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 899cb3da4b2f..7b921c4397d0 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -402,7 +400,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -431,8 +428,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -456,7 +453,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,7 +479,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -554,8 +550,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -579,7 +575,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -606,7 +601,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -677,8 +672,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -702,7 +697,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +723,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 72510f50c873..4743dc89eee1 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 8fda58ce6cd0..0a47f77ab96b 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bf6a2e95a756..0a3c0849a075 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 6c3cb73e0116..0b694e42fb43 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1fec8fd31283..a055321ccbfc 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f2e6777e774c..6bffeb5f9bfd 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('FirewallPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -355,6 +351,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 57faf11dacb5..8735d9aa9aba 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3260ce86113a..c0305939ffce 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLog') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLog', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified flow log resource. :param resource_group_name: The name of the resource group. @@ -372,6 +368,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -385,15 +385,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0896d22a2b25..4738860de0f4 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b247ecaa6d52..29329c06b0f1 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 314c825a7159..c967ab98c5d9 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 @@ -93,7 +93,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -177,7 +174,7 @@ def begin_create_or_update( parameters, # type: "models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -281,7 +278,6 @@ def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -331,7 +327,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -352,7 +347,7 @@ def begin_delete( ip_groups_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -426,6 +421,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -438,15 +437,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -492,6 +487,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -503,15 +502,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6fdbc65626ac..e9b38ce78073 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 0d39645b01ca..507041b98f94 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 1ea013a943a2..d94f5efeb780 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 91c839feb8d0..2bcdbb43295e 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e5c42b680293..682270d3b502 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ff9f9f5c951d..2238bf85ae18 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 4e4168578600..bb2ef42d4e6c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dfe0c2677aac..85e123b3ebf6 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ff7f3913aad5..3e0ead970e3c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 586e73adefbe..89caff664c17 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 53bbeb4c6ca1..f4740b2608f0 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a158e308f301..3521d6bc8e2e 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 beb29d434f7a..a77426259767 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,8 +533,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -561,7 +556,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -586,7 +580,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -648,8 +642,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -671,7 +665,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -696,7 +689,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -780,6 +773,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -794,15 +791,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -853,6 +846,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -866,15 +863,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -954,7 +947,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1004,6 +996,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1021,15 +1017,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1113,7 +1105,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 f4dce2226bd1..a9e74a2a5069 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 @@ -34,8 +34,8 @@ def _put_bastion_shareable_link_initial( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> "models.BastionShareableLinkListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + # type: (...) -> Optional["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -59,7 +59,6 @@ def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -89,7 +88,7 @@ def begin_put_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["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. @@ -179,7 +178,6 @@ def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -204,7 +202,7 @@ def begin_delete_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -288,6 +286,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -301,19 +304,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -347,8 +349,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionActiveSessionListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + # type: (...) -> Optional["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -370,7 +372,6 @@ def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +396,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionActiveSessionListResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -479,6 +480,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -492,19 +498,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -573,7 +578,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +635,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -655,8 +658,8 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -680,7 +683,6 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -710,7 +712,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. 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 7e2bcab57f68..05ea397ac524 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 06f82a260b61..d5ff314caf19 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2cddffc1498a..21e514074ce1 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1708,7 +1684,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1722,7 +1697,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1742,7 +1716,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1834,7 +1808,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1848,7 +1821,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1868,7 +1840,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 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 c8d7efb04d1b..e58ccb43a576 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 61dd8cc5c0d0..be337628227d 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -275,7 +272,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -324,7 +320,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -344,7 +339,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,6 +413,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -483,6 +478,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -494,15 +493,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -536,8 +531,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -561,7 +556,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -591,7 +585,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -657,8 +651,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> Optional["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -680,7 +674,6 @@ def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -705,7 +698,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -769,8 +762,8 @@ def _get_p2_s_vpn_connection_health_detailed_initial( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnConnectionHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + # type: (...) -> Optional["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -794,7 +787,6 @@ def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -824,7 +816,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -915,7 +907,6 @@ def _disconnect_p2_s_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -940,7 +931,7 @@ def begin_disconnect_p2_s_vpn_connections( request, # type: "models.P2SVpnConnectionRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. 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 8eea9a2964de..72a778a4ea50 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b6a63f955a60..4706952a7c63 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 32e1ffc71f0b..25674a98a6f1 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( private_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2b2a0bee4043..18d2285bae12 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -521,7 +517,6 @@ def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -588,7 +583,6 @@ def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -640,7 +634,6 @@ def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -662,7 +655,7 @@ def begin_delete_private_endpoint_connection( pe_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -742,6 +735,10 @@ def list_private_endpoint_connections( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -755,15 +752,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -791,32 +784,21 @@ def get_next(next_link=None): ) list_private_endpoint_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections'} # type: ignore - def check_private_link_service_visibility( + def _check_private_link_service_visibility_initial( self, location, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "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.v2019_11_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -832,7 +814,6 @@ def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -841,48 +822,98 @@ def check_private_link_service_visibility( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - def check_private_link_service_visibility_by_resource_group( + def begin_check_private_link_service_visibility( self, location, # type: str - resource_group_name, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" - """Checks whether the subscription is visible to private link service in the specified resource - group. + # 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 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.v2019_11_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_11_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_11_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -899,7 +930,6 @@ def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -908,17 +938,86 @@ def check_private_link_service_visibility_by_resource_group( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_11_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.v2019_11_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -942,6 +1041,10 @@ def list_auto_approved_private_link_services( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -954,15 +1057,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1014,6 +1113,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1027,15 +1130,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1019463b89f6..3538ccb49ec4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -556,6 +551,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -569,15 +568,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -638,6 +633,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -654,15 +653,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -750,7 +745,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e02e94fc44ef..27df096b8faa 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e2a18e6d12c2..c7b4616485de 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 dbbb4ceb0408..944bc6c0026d 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list_by_route_filter( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 df8ec4f216b8..87f1ac2849a0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -422,6 +417,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -434,15 +433,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -487,6 +482,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6b1d44453077..0552a21378ed 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0bcab84330ce..8972ca0492fa 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2ae3b1be7251..c16284e189c8 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 14377609b358..296c7046b399 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 3b08b459b5a2..33af3e16c094 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7f82e02e4f40..c254d154efd2 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9b434781dc37..71ec83765fde 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 @@ -82,7 +82,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 24f44c11fef1..03b09fd23a17 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -502,7 +497,6 @@ def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -528,7 +522,7 @@ def begin_unprepare_network_policies( unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -612,6 +606,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -625,15 +623,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c056ab2458e4..c8567edb2a09 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1559ea73c4ee..b918292cb541 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -374,6 +370,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 176988a8af73..21d92dedb5ce 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualHub', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 33b986772dbe..52aa64e82116 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -340,8 +336,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -487,7 +482,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -500,7 +494,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -520,7 +513,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -624,7 +617,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,6 +655,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -675,15 +671,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -717,8 +709,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -742,7 +734,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -772,7 +763,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -842,8 +833,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -867,7 +858,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -901,7 +891,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -969,8 +959,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -994,7 +984,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1025,7 +1014,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 55b54bde005d..483f0ece2fc8 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,6 +537,10 @@ def list_connections( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -555,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -597,8 +592,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -622,7 +617,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -648,7 +642,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -736,7 +730,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -756,7 +749,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -817,8 +810,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -842,7 +835,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -940,8 +932,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -965,7 +957,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -995,7 +986,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1062,8 +1053,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1085,7 +1076,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1174,8 +1164,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1199,7 +1189,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1225,7 +1214,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1324,7 +1313,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1347,8 +1335,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1370,7 +1358,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1395,7 +1382,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1459,8 +1446,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1483,7 +1470,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1509,7 +1495,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1576,8 +1562,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1601,7 +1587,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1631,7 +1616,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1721,7 +1706,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1744,7 +1728,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1848,7 +1832,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1876,8 +1859,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -1901,7 +1884,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1935,7 +1917,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2002,8 +1984,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -2027,7 +2009,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2058,7 +2039,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2124,8 +2105,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientConnectionHealthDetailListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -2147,7 +2128,6 @@ def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2172,7 +2152,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2260,7 +2240,6 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -2285,7 +2264,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( request, # type: "models.P2SVpnConnectionRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 16ebeb0075b6..05f9aa1696ad 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fb51abfa5604..bf64ef9f373c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0fd14c56e289..36b651bfcb01 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -576,7 +571,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -617,6 +611,10 @@ def list_usage( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -630,15 +628,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4e0a7d65bc0c..64db8f1febb5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +98,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -199,7 +198,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -265,7 +262,6 @@ def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -286,7 +282,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -373,6 +369,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cbdd6538097d..3eafbd674bd8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -358,6 +354,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 24f61053ec7b..c66675b89c06 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualWAN', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c5929699f643..05d6e2ed12b7 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -142,7 +141,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -155,7 +153,6 @@ 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('VpnConnection', pipeline_response) @@ -176,7 +173,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -269,7 +266,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -290,7 +286,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -370,6 +366,10 @@ def list_by_vpn_gateway( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5295fe769297..32fd75bdc8ab 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -274,7 +271,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -323,7 +319,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +338,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -402,8 +397,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> Optional["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -425,7 +420,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -450,7 +444,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -527,6 +521,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -539,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -592,6 +586,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 75e6e0f2a55d..837f8ef2a322 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 @@ -73,6 +73,10 @@ def list_by_vpn_connection( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -87,15 +91,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a5a20eb433d9..89b0e2b90fff 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 @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfigurationsResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-11-01" @@ -75,7 +75,6 @@ def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 e5f50abc1c66..5096d3c33cc0 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -277,7 +274,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -326,7 +322,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -346,7 +341,7 @@ def begin_delete( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,6 +415,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -496,15 +495,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 96a4b3ec87a4..52be00b41e6a 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 @@ -92,7 +92,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 666a1eea6ce8..d43e6d75841d 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list_by_vpn_site( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 96d869628eee..3ee936187144 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -102,7 +101,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 137d2bbbfe0f..afca76cfc9f5 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnSite', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4039c04b6287..b1f268b7e1fc 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 @@ -68,6 +68,10 @@ def list( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2019-11-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 50d14427daf0..3c0da51ad8f0 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 @@ -138,51 +138,43 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "operation_name": "_put_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_put_bastion_shareable_link_initial", - "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 \"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", "coroutine": true }, "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" }, - "put_bastion_shareable_link" : { + "begin_put_bastion_shareable_link" : { "sync": { - "operation_name": "begin_put_bastion_shareable_link", "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" }, "async": { - "operation_name": "put_bastion_shareable_link", - "signature": "async def 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 \"models.BastionShareableLinkListResult\":\n", + "signature": "async 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[\"models.BastionShareableLinkListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "_delete_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_delete_bastion_shareable_link_initial", "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", "coroutine": true }, "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" }, - "delete_bastion_shareable_link" : { + "begin_delete_bastion_shareable_link" : { "sync": { - "operation_name": "begin_delete_bastion_shareable_link", "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" }, "async": { - "operation_name": "delete_bastion_shareable_link", - "signature": "async def 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 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", "coroutine": true }, "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:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", @@ -190,11 +182,9 @@ }, "get_bastion_shareable_link" : { "sync": { - "operation_name": "get_bastion_shareable_link", "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" }, "async": { - "operation_name": "get_bastion_shareable_link", "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", "coroutine": false }, @@ -203,37 +193,31 @@ }, "_get_active_sessions_initial" : { "sync": { - "operation_name": "_get_active_sessions_initial", "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" }, "async": { - "operation_name": "_get_active_sessions_initial", - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"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", "coroutine": true }, "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" }, - "get_active_sessions" : { + "begin_get_active_sessions" : { "sync": { - "operation_name": "begin_get_active_sessions", "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" }, "async": { - "operation_name": "get_active_sessions", - "signature": "async def get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"models.BastionActiveSessionListResult\":\n", + "signature": "async def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.BastionActiveSessionListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "disconnect_active_sessions", "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" }, "async": { - "operation_name": "disconnect_active_sessions", "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", "coroutine": false }, @@ -242,11 +226,9 @@ }, "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -255,11 +237,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -268,31 +248,27 @@ }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", "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" }, "async": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", - "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 \"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", "coroutine": true }, "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" }, - "generatevirtualwanvpnserverconfigurationvpnprofile" : { + "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "operation_name": "begin_generatevirtualwanvpnserverconfigurationvpnprofile", "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" }, "async": { - "operation_name": "generatevirtualwanvpnserverconfigurationvpnprofile", - "signature": "async def generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e \"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", "coroutine": true }, - "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: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\"\"\"", + "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:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~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" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.paging import ItemPaged\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.arm_polling import ARMPolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union", - "async_imports": "from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.async_paging import AsyncItemPaged, AsyncList\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"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\": [\"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/v2019_12_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_application_gateways_operations_async.py index b2ac3de0f861..7b2318c31604 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -542,7 +537,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -561,7 +555,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -574,8 +568,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -641,7 +635,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -660,7 +653,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -673,8 +666,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -719,8 +712,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -744,7 +737,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -769,7 +761,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -784,8 +776,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -835,8 +827,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -862,7 +854,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -892,7 +883,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -910,8 +901,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -986,7 +977,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1035,7 +1025,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1084,7 +1073,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1133,7 +1121,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1181,7 +1168,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1215,6 +1201,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1226,15 +1216,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1296,7 +1282,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_application_security_groups_operations_async.py index 2426f30d584b..2e46e5eefbe5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -365,7 +361,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,6 +398,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -414,15 +413,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_delegations_operations_async.py index 9bd5ba9d9b00..f55e8d37232a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_endpoint_services_operations_async.py index 331833761395..0368b1a9f6fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_private_endpoint_types_operations_async.py index 49776dc45517..4e4116b56dc7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_private_endpoint_types_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -62,6 +62,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -146,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index bc5cb8048572..69ca285b17d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_service_aliases_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_service_aliases_operations_async.py index 40a5177bbc06..a3489e4feb63 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_service_aliases_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_available_service_aliases_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -131,6 +131,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 379732524994..54d7b1cc17dc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_azure_firewalls_operations_async.py index cecdf1da8346..03a7474a0bac 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_bastion_hosts_operations_async.py index 3add750235e0..1a0caeb36858 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_bastion_hosts_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('BastionHost', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( bastion_host_name: str, parameters: "models.BastionHost", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_bgp_service_communities_operations_async.py index 64d573f7be9d..3e431b1b862c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_connection_monitors_operations_async.py index d365c3f1d6ff..d6924bbfbe1e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -387,7 +383,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -438,7 +433,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -459,7 +453,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -474,8 +468,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -544,7 +538,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -565,7 +558,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -580,8 +573,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -651,7 +644,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -661,7 +653,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -680,7 +671,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -695,8 +686,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -762,6 +753,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -775,15 +770,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ddos_custom_policies_operations_async.py index 45298a20953a..556b214e4f7f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,7 +359,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ddos_protection_plans_operations_async.py index 0440b5d9c948..40c4d9d9178a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_default_security_rules_operations_async.py index 162a16772196..eb5f4eba5e71 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 10f96ad1b530..9d93823125bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index cbc6824681b8..ea389667a4b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 4f3bd338c53c..fecbba3561da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuits_operations_async.py index 75e1e1084e6c..6703ffdd2bb6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -392,8 +387,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -417,7 +412,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -443,7 +437,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -461,8 +455,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -513,8 +507,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -538,7 +532,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -564,7 +557,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -582,8 +575,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -634,8 +627,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -659,7 +652,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -685,7 +677,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -703,8 +695,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -787,7 +779,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -847,7 +838,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -884,6 +874,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -896,15 +890,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -948,6 +938,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -959,15 +953,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_connections_operations_async.py index 951707f0a2e6..30989d95baa1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index afc88f4b6f43..1fa7e237bfdf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_cross_connections_operations_async.py index a62ec8ebcf83..c65846fe4925 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -392,7 +390,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -420,8 +417,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -445,7 +442,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -471,7 +467,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -489,8 +485,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -541,8 +537,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -566,7 +562,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -592,7 +587,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -610,8 +605,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -662,8 +657,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -687,7 +682,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -713,7 +707,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -731,8 +725,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_gateways_operations_async.py index 1a263acd008b..eeac0ebc7a85 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_links_operations_async.py index 3d8182cc4305..513a07c9c993 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_ports_locations_operations_async.py index aa1ed50ba53e..d39eb2235b73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_ports_operations_async.py index 046224d1359e..112b5b6a7640 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_service_providers_operations_async.py index 7036846d6ae8..2ba5b24a13ea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_firewall_policies_operations_async.py index 534098338051..b11836cec939 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_firewall_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('FirewallPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( firewall_policy_name: str, parameters: "models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": + ) -> AsyncLROPoller["models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: FirewallPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.FirewallPolicy + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.FirewallPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py index 6825070ca5e8..5c14667ac28a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_group_name: str, parameters: "models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: FirewallPolicyRuleGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.FirewallPolicyRuleGroup + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.FirewallPolicyRuleGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_flow_logs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_flow_logs_operations_async.py index 459bc3dfd350..b6c26ac41c55 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_flow_logs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_flow_logs_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLog') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLog', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( flow_log_name: str, parameters: "models.FlowLog", **kwargs - ) -> "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. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: FlowLog, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.FlowLog + :return: An instance of AsyncLROPoller that returns either FlowLog or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.FlowLog] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified flow log resource. :param resource_group_name: The name of the resource group. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -362,6 +358,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 5f5222195338..be1bfdd9336a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_inbound_nat_rules_operations_async.py index a6940dd91ed6..fe3dda908717 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ip_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ip_groups_operations_async.py index acb11141b83f..94c459ec6fb1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ip_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_ip_groups_operations_async.py @@ -88,7 +88,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -170,7 +167,7 @@ async def begin_create_or_update( ip_groups_name: str, parameters: "models.IpGroup", **kwargs - ) -> "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. @@ -185,8 +182,8 @@ async def begin_create_or_update( 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: IpGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.IpGroup + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.IpGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -273,7 +270,6 @@ async def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -342,7 +337,7 @@ async def begin_delete( resource_group_name: str, ip_groups_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -355,8 +350,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -415,6 +410,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -427,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -491,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index 16c4c571fbd0..e9d50d91f5f5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 12cbeac4c7c6..8817d682ee52 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 00e225fd548c..b5b195527265 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 7ad14269a84a..bd5eb3ef08e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 641557a329ba..194a422ffdd8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_probes_operations_async.py index 51ce6d56a80d..22d8bd4e6e8c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancers_operations_async.py index 827e7cd0d175..a59eaee7babb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_local_network_gateways_operations_async.py index 23daba370b62..3212431c04ea 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_nat_gateways_operations_async.py index 014245250381..d79a0e32ea2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 4fb0b8c33d56..75a77d568074 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index 9591cbaef23d..eb311137a88f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 2d0c405984fb..03ac23aa22c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interfaces_operations_async.py index 2ea8669d83e4..5112d6510c44 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,8 +520,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -548,7 +543,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -572,7 +566,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -585,8 +579,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -633,8 +627,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -656,7 +650,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -680,7 +673,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -693,8 +686,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -763,6 +756,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -777,15 +774,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -835,6 +828,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -848,15 +845,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -935,7 +928,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -984,6 +976,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1001,15 +997,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1092,7 +1084,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_management_client_operations_async.py index 6d86a7f61a70..129d0e93c67e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_management_client_operations_async.py @@ -29,8 +29,8 @@ async def _put_bastion_shareable_link_initial( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + ) -> Optional["models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -54,7 +54,6 @@ async def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -83,7 +82,7 @@ async def begin_put_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": + ) -> AsyncLROPoller["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. @@ -98,8 +97,8 @@ async def begin_put_bastion_shareable_link( 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: BastionShareableLinkListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult + :return: An instance of AsyncLROPoller that returns either BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.BastionShareableLinkListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -172,7 +171,6 @@ async def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -196,7 +194,7 @@ async def begin_delete_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> None: + ) -> 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. @@ -211,8 +209,8 @@ async def begin_delete_bastion_shareable_link( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -279,6 +277,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -292,19 +295,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -337,8 +339,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + ) -> Optional["models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -360,7 +362,6 @@ async def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -384,7 +385,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": + ) -> AsyncLROPoller["models.BastionActiveSessionListResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -397,8 +398,8 @@ async def begin_get_active_sessions( 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: BastionActiveSessionListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.BastionActiveSessionListResult + :return: An instance of AsyncLROPoller that returns either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.BastionActiveSessionListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -467,6 +468,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -480,19 +486,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -560,7 +565,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -617,7 +621,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -640,8 +643,8 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -665,7 +668,6 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -694,7 +696,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": + ) -> AsyncLROPoller["models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -712,8 +714,8 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_profiles_operations_async.py index 6c6c0b75336c..8b79c7f112ae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_security_groups_operations_async.py index aff170ce1873..33f87847be9d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_virtual_appliances_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_virtual_appliances_operations_async.py index bdc1265e738c..f6fb2bdbd7ca 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_virtual_appliances_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_virtual_appliances_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_virtual_appliance_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -299,7 +296,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkVirtualAppliance') body_content_kwargs['content'] = body_content @@ -312,7 +308,6 @@ 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('NetworkVirtualAppliance', pipeline_response) @@ -331,7 +326,7 @@ async def begin_create_or_update( network_virtual_appliance_name: str, parameters: "models.NetworkVirtualAppliance", **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> AsyncLROPoller["models.NetworkVirtualAppliance"]: """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -346,8 +341,8 @@ async def begin_create_or_update( 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: NetworkVirtualAppliance, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkVirtualAppliance + :return: An instance of AsyncLROPoller that returns either NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.NetworkVirtualAppliance] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -410,6 +405,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -422,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_watchers_operations_async.py index 40d7af8466b3..982d85962b9b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "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. @@ -1602,8 +1578,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1677,7 +1653,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1691,7 +1666,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1710,7 +1684,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1726,8 +1700,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1801,7 +1775,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1815,7 +1788,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1834,7 +1806,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "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 @@ -1853,8 +1825,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_operations_async.py index e434335de0a9..fd76bf539396 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index d90d11f668ac..0973b4804fe5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -267,7 +264,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -315,7 +311,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -334,7 +329,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -347,8 +342,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,6 +402,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -471,6 +466,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -523,8 +518,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -548,7 +543,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -577,7 +571,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -593,8 +587,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -642,8 +636,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> Optional["models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -665,7 +659,6 @@ async def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -689,7 +682,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -703,8 +696,8 @@ async def begin_get_p2_s_vpn_connection_health( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -752,8 +745,8 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "models.P2SVpnConnectionHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + ) -> Optional["models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -777,7 +770,6 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -806,7 +798,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "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. @@ -822,8 +814,8 @@ async def begin_get_p2_s_vpn_connection_health_detailed( 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: P2SVpnConnectionHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.P2SVpnConnectionHealth + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.P2SVpnConnectionHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -896,7 +888,6 @@ async def _disconnect_p2_s_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -920,7 +911,7 @@ async def begin_disconnect_p2_s_vpn_connections( p2_s_vpn_gateway_name: str, request: "models.P2SVpnConnectionRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. @@ -936,8 +927,8 @@ async def begin_disconnect_p2_s_vpn_connections( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_packet_captures_operations_async.py index 261256797df8..01143e56c762 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index 1c56e74b9091..e4cb7c545391 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_private_endpoints_operations_async.py index 9e695edc5a4a..d8bde782670e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_private_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_private_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, private_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( private_endpoint_name: str, parameters: "models.PrivateEndpoint", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateEndpoint + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.PrivateEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_private_link_services_operations_async.py index 114c14b90b19..a11d6b35d2f2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_private_link_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_private_link_services_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, service_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( service_name: str, parameters: "models.PrivateLinkService", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateLinkService, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateLinkService + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.PrivateLinkService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -509,7 +505,6 @@ async def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -575,7 +570,6 @@ async def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -626,7 +620,6 @@ async def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -647,7 +640,7 @@ async def begin_delete_private_endpoint_connection( service_name: str, pe_connection_name: str, **kwargs - ) -> None: + ) -> 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. @@ -662,8 +655,8 @@ async def begin_delete_private_endpoint_connection( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -726,6 +719,10 @@ def list_private_endpoint_connections( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -739,15 +736,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -775,31 +768,20 @@ async def get_next(next_link=None): ) 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( + async def _check_private_link_service_visibility_initial( self, location: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "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.v2019_12_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + ) -> Optional["models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -815,7 +797,6 @@ async def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -824,47 +805,96 @@ async def check_private_link_service_visibility( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - async def check_private_link_service_visibility_by_resource_group( + async def begin_check_private_link_service_visibility( self, location: str, - resource_group_name: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": - """Checks whether the subscription is visible to private link service in the specified resource - group. + ) -> 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 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.v2019_12_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_12_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -881,7 +911,6 @@ async def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -890,17 +919,85 @@ async def check_private_link_service_visibility_by_resource_group( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_12_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.v2019_12_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -923,6 +1020,10 @@ def list_auto_approved_private_link_services( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -935,15 +1036,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -994,6 +1091,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1007,15 +1108,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_public_ip_addresses_operations_async.py index 1886f7054d85..0d45b50b2ea4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -543,6 +538,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -556,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -624,6 +619,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -640,15 +639,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -735,7 +730,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_public_ip_prefixes_operations_async.py index 94b899b879aa..419c302e24e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_resource_navigation_links_operations_async.py index ffbb913045d2..7cb5f267fbe6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_filter_rules_operations_async.py index 5c256a006ad8..af7c4fa9ff52 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list_by_route_filter( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_filters_operations_async.py index ba78232b4199..f011f78c56a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -411,6 +406,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -423,15 +422,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -475,6 +470,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_tables_operations_async.py index d36a4515ee18..55468e53e470 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -422,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_routes_operations_async.py index c233bcde5ace..3d3b0a4f3a2a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_security_rules_operations_async.py index 104975bff784..975e876ee630 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_association_links_operations_async.py index e0d2177e1446..b47431e2f7db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_endpoint_policies_operations_async.py index dce8c6bb360a..0a33f3e2f758 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index 30efa63cfa3c..76cb1a606625 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_tags_operations_async.py index ee4579c5544e..f13e5c71a0a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_service_tags_operations_async.py @@ -77,7 +77,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_subnets_operations_async.py index 801435fa93ab..749dc7287526 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -490,7 +485,6 @@ async def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -515,7 +509,7 @@ async def begin_unprepare_network_policies( subnet_name: str, unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -533,8 +527,8 @@ async def begin_unprepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -598,6 +592,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -611,15 +609,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_usages_operations_async.py index 68bf285ff541..bd5fd8ebea1b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py index 93bee1d90aa2..e04db36a3535 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( route_table_name: str, virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: VirtualHubRouteTableV2, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualHubRouteTableV2 + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualHubRouteTableV2] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_hubs_operations_async.py index 5c11d8147d98..823f79b8aa2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualHub', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 212c26ca5b17..c45206197434 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -330,8 +326,8 @@ async def _update_tags_initial( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> Optional["models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -400,8 +395,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,7 +470,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -488,7 +482,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -507,7 +500,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -525,8 +518,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -610,7 +603,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -648,6 +640,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -660,15 +656,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -701,8 +693,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -726,7 +718,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -755,7 +746,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -774,8 +765,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -824,8 +815,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -849,7 +840,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -882,7 +872,7 @@ async def begin_start_packet_capture( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> 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. @@ -899,8 +889,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -949,8 +939,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -974,7 +964,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1004,7 +993,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> 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. @@ -1021,8 +1010,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py index 48e226146827..f12d5498c215 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -326,8 +322,8 @@ async def _update_tags_initial( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,6 +524,10 @@ def list_connections( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -542,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -583,8 +578,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -608,7 +603,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -633,7 +627,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -649,8 +643,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -720,7 +714,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -739,7 +732,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -753,8 +746,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -799,8 +792,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -824,7 +817,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -853,7 +845,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -870,8 +862,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -920,8 +912,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -945,7 +937,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -974,7 +965,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -991,8 +982,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1040,8 +1031,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1063,7 +1054,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1101,8 +1091,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1150,8 +1140,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1175,7 +1165,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1200,7 +1189,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1215,8 +1204,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1298,7 +1287,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1320,8 +1308,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1343,7 +1331,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1367,7 +1354,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1381,8 +1368,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1430,8 +1417,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1454,7 +1441,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1479,7 +1465,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1495,8 +1481,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1545,8 +1531,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1570,7 +1556,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1599,7 +1584,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1616,8 +1601,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1688,7 +1673,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1710,7 +1694,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1725,8 +1709,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1797,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1840,8 +1823,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1865,7 +1848,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1898,7 +1880,7 @@ async def begin_start_packet_capture( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -1914,8 +1896,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1964,8 +1946,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1989,7 +1971,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2019,7 +2000,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2035,8 +2016,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -2084,8 +2065,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientConnectionHealthDetailListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -2107,7 +2088,6 @@ async def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -2131,7 +2111,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -2145,8 +2125,8 @@ async def begin_get_vpnclient_connection_health( 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: VpnClientConnectionHealthDetailListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnClientConnectionHealthDetailListResult + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnClientConnectionHealthDetailListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2218,7 +2198,6 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -2242,7 +2221,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( virtual_network_gateway_name: str, request: "models.P2SVpnConnectionRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2257,8 +2236,8 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py index ddd2dd694fb0..2b8e5f0fbfe8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_taps_operations_async.py index c7279190e503..6d0a7378eb6e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_networks_operations_async.py index 619d32c79a1c..0ea238273832 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -563,7 +558,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -603,6 +597,10 @@ def list_usage( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -616,15 +614,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_router_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_router_peerings_operations_async.py index 39921ca33797..9b4e1083906d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_router_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_router_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -93,7 +92,7 @@ async def begin_delete( virtual_router_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -192,7 +191,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -257,7 +254,6 @@ async def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -277,7 +273,7 @@ async def begin_create_or_update( peering_name: str, parameters: "models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": + ) -> AsyncLROPoller["models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_create_or_update( 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: VirtualRouterPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualRouterPeering + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualRouterPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,6 +359,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_routers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_routers_operations_async.py index 1706e53f9a9d..27bd20a35f06 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_routers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_routers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( virtual_router_name: str, parameters: "models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": + ) -> AsyncLROPoller["models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: VirtualRouter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualRouter + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualRouter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_wans_operations_async.py index 4594eb1ee666..323be469cea8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualWAN', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_connections_operations_async.py index 1099876f5513..e22702abc9a0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -136,7 +135,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnConnection', pipeline_response) @@ -169,7 +166,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -187,8 +184,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -261,7 +258,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -281,7 +277,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -296,8 +292,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,6 +356,10 @@ def list_by_vpn_gateway( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_gateways_operations_async.py index 2002fa4ab021..475c5e9888b4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -266,7 +263,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -314,7 +310,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +328,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -346,8 +341,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -391,8 +386,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> Optional["models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -414,7 +409,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -438,7 +432,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> "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. @@ -451,8 +445,8 @@ async def begin_reset( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -514,6 +508,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -526,15 +524,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -578,6 +572,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_link_connections_operations_async.py index d024a01d1115..8b4f1b77c2d5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -68,6 +68,10 @@ def list_by_vpn_connection( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py index 76cfcb06d4dd..17310a66a000 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VpnServerConfigurationsResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + ) -> Optional["models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -70,7 +70,6 @@ async def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "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. @@ -108,8 +107,8 @@ async def begin_list( 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: VpnServerConfigurationsResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnServerConfigurationsResponse + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationsResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnServerConfigurationsResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_server_configurations_operations_async.py index be939143885f..5b6fad64527d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_server_configurations_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_server_configuration_name: str, vpn_server_configuration_parameters: "models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> AsyncLROPoller["models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -269,7 +266,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -317,7 +313,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -336,7 +331,7 @@ async def begin_delete( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -349,8 +344,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -409,6 +404,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -484,15 +483,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_site_link_connections_operations_async.py index 1e3817727c11..69a1b4197f89 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_site_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_site_link_connections_operations_async.py @@ -87,7 +87,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_site_links_operations_async.py index 600da45a6a8d..fd8935aa417f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_site_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list_by_vpn_site( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index eb0fbdedee56..566cb96d82a1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -96,7 +95,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -112,8 +111,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_sites_operations_async.py index 0d697c61a35a..fa0e3b1ab5f4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnSite', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2019_12_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index b0acf24e55e1..7a97e1d87a73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] 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 598c9b68ae66..edbaffc4eb3a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -555,7 +550,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -575,7 +569,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -656,7 +650,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +669,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -736,8 +729,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -761,7 +754,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -787,7 +779,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -854,8 +846,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -881,7 +873,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -912,7 +903,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1007,7 +998,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,7 +1047,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1107,7 +1096,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1157,7 +1145,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1206,7 +1193,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1241,6 +1227,10 @@ def list_available_ssl_predefined_policies( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1252,15 +1242,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1323,7 +1309,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 bbbf7de98b19..fc5e6ec8d755 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -375,7 +371,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -414,6 +409,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -425,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -493,15 +492,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 70ab22de038f..c0327f022599 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8fb87fa2d938..77ef9694ef14 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a6bccd679b47..db8621f00ab5 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 @@ -67,6 +67,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,6 +139,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -152,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e3649db60b2a..d32523c2be9e 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1c9eb5549896..98a0b5463ebe 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -137,6 +137,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -150,15 +154,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1e3b67dfaae9..d199ac203cfa 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8465d08a6d57..fafe813c84ec 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2ce2ae4e56ce..87d10cb4393e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('BastionHost', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a309a3d7d385..47c95ea126fa 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a6de3fa4c74a..d3b5e3540b9e 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -397,7 +393,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -449,7 +444,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -471,7 +465,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -557,7 +551,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -579,7 +572,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -666,7 +659,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +668,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -696,7 +687,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -779,6 +770,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -792,15 +787,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9bdb52684776..aded28311826 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -373,7 +369,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content 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 7e4d0d97c1de..8d657342a5b3 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bfc0e2bb5e3a..e4a145d6f632 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ad0c2180793f..de81816b12a2 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0f7fca7d9ebb..ed51784d02c9 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 819c1431778a..e39a3383e058 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 377d6b7f643a..7b981961bf1a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,8 +398,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -428,7 +423,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +449,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -526,8 +520,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -551,7 +545,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -578,7 +571,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -649,8 +642,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -674,7 +667,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -701,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -804,7 +796,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -865,7 +856,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -903,6 +893,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -915,15 +909,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -968,6 +958,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -979,15 +973,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 48df5a35bdce..aa2d2eaf5cc5 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8613840d9c73..8a09dd7dd289 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 eb8a14ced49e..d682449ce4e2 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -402,7 +400,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -431,8 +428,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -456,7 +453,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,7 +479,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -554,8 +550,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -579,7 +575,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -606,7 +601,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -677,8 +672,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -702,7 +697,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +723,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 a8a988d9c469..0f3312a0e88a 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 c9c41168cf79..75e77fb8609b 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 62d01eddeacb..6a8fbcf0e759 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 @@ -65,6 +65,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 45d711d9889b..a9cef4a9c428 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b994d24fda9f..cbd07b94504e 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 33f7e59e6e45..611e61bb1f00 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('FirewallPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -355,6 +351,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2d206a24602e..1a6e6c760716 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b5851fa3a969..279eecf9993b 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLog') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLog', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified flow log resource. :param resource_group_name: The name of the resource group. @@ -372,6 +368,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -385,15 +385,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 714cd40e823c..5ab8cec82c39 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 26fab3fe37c4..a9fbcc62ffc2 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 @@ -71,6 +71,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 926f3ad8210c..d70705dba941 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 @@ -93,7 +93,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -177,7 +174,7 @@ def begin_create_or_update( parameters, # type: "models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -281,7 +278,6 @@ def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -331,7 +327,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -352,7 +347,7 @@ def begin_delete( ip_groups_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -426,6 +421,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -438,15 +437,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -492,6 +487,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -503,15 +502,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 44d8dbbb7d1a..cbc386d07227 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 780cb9daebff..6418b0ce5852 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 9b66e49fea9a..29f66915ce07 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 07e51795b86c..f95589d5c4aa 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fc4137c0b0be..03fa2d484476 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5f6df3666b32..6d9875dbc16d 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 6d1a5a8efab0..1b239f3f609e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cb2c23d208b0..bb8c3c00fedf 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2934e921c820..08454f497128 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a2bbdb87303b..201a58f1025e 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 febf2faa1433..cdf732cd3c80 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 @@ -69,6 +69,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ab3820a91bb2..d0bd85797d42 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 46900a835603..351e78dc6367 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,8 +533,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -561,7 +556,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -586,7 +580,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -648,8 +642,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -671,7 +665,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -696,7 +689,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -780,6 +773,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -794,15 +791,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -853,6 +846,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -866,15 +863,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -954,7 +947,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1004,6 +996,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1021,15 +1017,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1113,7 +1105,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 9f0431844f00..4bc0ea856313 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 @@ -34,8 +34,8 @@ def _put_bastion_shareable_link_initial( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> "models.BastionShareableLinkListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + # type: (...) -> Optional["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -59,7 +59,6 @@ def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -89,7 +88,7 @@ def begin_put_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["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. @@ -179,7 +178,6 @@ def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -204,7 +202,7 @@ def begin_delete_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -288,6 +286,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -301,19 +304,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -347,8 +349,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionActiveSessionListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + # type: (...) -> Optional["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -370,7 +372,6 @@ def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +396,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionActiveSessionListResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -479,6 +480,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -492,19 +498,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -573,7 +578,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +635,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -655,8 +658,8 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -680,7 +683,6 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -710,7 +712,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. 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 112edfdb124f..95b5b531f582 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1ac732123191..23a6405bf4e5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d588f08d48bc..de26bc48e2eb 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_virtual_appliance_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -308,7 +305,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkVirtualAppliance') body_content_kwargs['content'] = body_content @@ -321,7 +317,6 @@ 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('NetworkVirtualAppliance', pipeline_response) @@ -341,7 +336,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkVirtualAppliance"] """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -421,6 +416,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3278009e9544..0edb583f1068 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1708,7 +1684,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1722,7 +1697,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1742,7 +1716,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1834,7 +1808,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1848,7 +1821,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1868,7 +1840,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 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 71eb3c1ea2b0..6b12e4ddbf5a 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 @@ -63,6 +63,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6ffc9a3ba809..5bc54520320d 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -275,7 +272,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -324,7 +320,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -344,7 +339,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,6 +413,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -483,6 +478,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -494,15 +493,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -536,8 +531,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -561,7 +556,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -591,7 +585,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -657,8 +651,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> Optional["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -680,7 +674,6 @@ def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -705,7 +698,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -769,8 +762,8 @@ def _get_p2_s_vpn_connection_health_detailed_initial( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnConnectionHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + # type: (...) -> Optional["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -794,7 +787,6 @@ def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -824,7 +816,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -915,7 +907,6 @@ def _disconnect_p2_s_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -940,7 +931,7 @@ def begin_disconnect_p2_s_vpn_connections( request, # type: "models.P2SVpnConnectionRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. 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 6eb46d33c327..7dd15e4cafe2 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a90e7835ac09..a8ab20858e98 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 849c6994520e..ed70e4d13d75 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( private_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ecd4d40fd7cd..872a91ade1a5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -521,7 +517,6 @@ def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -588,7 +583,6 @@ def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -640,7 +634,6 @@ def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -662,7 +655,7 @@ def begin_delete_private_endpoint_connection( pe_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -742,6 +735,10 @@ def list_private_endpoint_connections( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -755,15 +752,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -791,32 +784,21 @@ def get_next(next_link=None): ) list_private_endpoint_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections'} # type: ignore - def check_private_link_service_visibility( + def _check_private_link_service_visibility_initial( self, location, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "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.v2019_12_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -832,7 +814,6 @@ def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -841,48 +822,98 @@ def check_private_link_service_visibility( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - def check_private_link_service_visibility_by_resource_group( + def begin_check_private_link_service_visibility( self, location, # type: str - resource_group_name, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" - """Checks whether the subscription is visible to private link service in the specified resource - group. + # 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 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.v2019_12_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2019_12_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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.v2019_12_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -899,7 +930,6 @@ def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -908,17 +938,86 @@ def check_private_link_service_visibility_by_resource_group( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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.v2019_12_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.v2019_12_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -942,6 +1041,10 @@ def list_auto_approved_private_link_services( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -954,15 +1057,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1014,6 +1113,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1027,15 +1130,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2087d1444650..07e8321a76c0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -556,6 +551,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -569,15 +568,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -638,6 +633,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -654,15 +653,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -750,7 +745,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 4efc5f50c50c..530aae5670eb 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 11cbecf9b451..b8971afe5ebc 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 f20d0da5617e..ce810ad5a673 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list_by_route_filter( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 25a98c0c4fac..b064810a2d72 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -422,6 +417,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -434,15 +433,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -487,6 +482,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cbe5cc395370..63ab32b1601b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c4480c7c7899..7c12e261232a 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 620441cfe8ff..dea21dce7645 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e29ea1abd94a..e7ecc7056912 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a32d52f2a49f..77228a8f0151 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a3026409da75..219489179cfd 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bda75786033d..23400ef32668 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 @@ -82,7 +82,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 34f20a575b08..2149258997d5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -502,7 +497,6 @@ def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -528,7 +522,7 @@ def begin_unprepare_network_policies( unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -612,6 +606,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -625,15 +623,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 66febd52aae8..7921cd5f9f49 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 @@ -66,6 +66,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3a14390f4d91..235c7e9f3c5e 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -374,6 +370,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 73fcfa6e1d1d..687814dd14cd 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualHub', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f37a7ab0b641..f202038801db 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -340,8 +336,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -487,7 +482,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -500,7 +494,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -520,7 +513,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -624,7 +617,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,6 +655,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -675,15 +671,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -717,8 +709,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -742,7 +734,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -772,7 +763,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -842,8 +833,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -867,7 +858,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -901,7 +891,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -969,8 +959,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -994,7 +984,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1025,7 +1014,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 15392a75e849..1432f47dda24 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,6 +537,10 @@ def list_connections( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -555,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -597,8 +592,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -622,7 +617,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -648,7 +642,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -736,7 +730,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -756,7 +749,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -817,8 +810,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -842,7 +835,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -940,8 +932,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -965,7 +957,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -995,7 +986,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1062,8 +1053,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1085,7 +1076,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1174,8 +1164,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1199,7 +1189,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1225,7 +1214,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1324,7 +1313,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1347,8 +1335,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1370,7 +1358,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1395,7 +1382,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1459,8 +1446,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1483,7 +1470,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1509,7 +1495,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1576,8 +1562,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1601,7 +1587,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1631,7 +1616,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1721,7 +1706,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1744,7 +1728,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1848,7 +1832,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1876,8 +1859,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -1901,7 +1884,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1935,7 +1917,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2002,8 +1984,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -2027,7 +2009,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2058,7 +2039,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2124,8 +2105,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientConnectionHealthDetailListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -2147,7 +2128,6 @@ def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2172,7 +2152,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2260,7 +2240,6 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -2285,7 +2264,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( request, # type: "models.P2SVpnConnectionRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 0c2c4aee3d5f..a8d3dc9babc3 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 52b7cddf1a4b..0ab704f045ef 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 14ecb7152d27..783cbed0c4b0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -576,7 +571,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -617,6 +611,10 @@ def list_usage( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -630,15 +628,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 84e9561592e9..eb9fde6035b7 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +98,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -199,7 +198,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -265,7 +262,6 @@ def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -286,7 +282,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -373,6 +369,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 45095d1e591f..289ff3c01e11 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -358,6 +354,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f9fcf962554d..e05d0156ed61 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualWAN', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6424dc0182f7..7fffbb1a7028 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -142,7 +141,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -155,7 +153,6 @@ 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('VpnConnection', pipeline_response) @@ -176,7 +173,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -269,7 +266,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -290,7 +286,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -370,6 +366,10 @@ def list_by_vpn_gateway( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 abd12f1b0c6d..5a2f1872d1df 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -274,7 +271,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -323,7 +319,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +338,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -402,8 +397,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> Optional["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -425,7 +420,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -450,7 +444,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -527,6 +521,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -539,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -592,6 +586,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2cef33a3a6e9..a0753195c77c 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 @@ -73,6 +73,10 @@ def list_by_vpn_connection( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -87,15 +91,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5868a4fe05cf..a8f7876e4c46 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 @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfigurationsResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2019-12-01" @@ -75,7 +75,6 @@ def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 67a15fc7fa8e..1a36fa550b1c 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -277,7 +274,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -326,7 +322,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -346,7 +341,7 @@ def begin_delete( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,6 +415,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -496,15 +495,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 bd64c2b3b15a..a91a51e18d68 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 @@ -92,7 +92,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 71b60a7c822a..7acdaa1f0249 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list_by_vpn_site( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 41aac95a51b5..0fe337344807 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -102,7 +101,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 f3450a2678ba..9fa560869de4 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnSite', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 209a83343981..49d8dc236fb9 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 @@ -68,6 +68,10 @@ def list( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2019-12-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 006f1871baa1..79d470cfd10e 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 @@ -141,51 +141,43 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "operation_name": "_put_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_put_bastion_shareable_link_initial", - "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 \"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", "coroutine": true }, "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" }, - "put_bastion_shareable_link" : { + "begin_put_bastion_shareable_link" : { "sync": { - "operation_name": "begin_put_bastion_shareable_link", "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" }, "async": { - "operation_name": "put_bastion_shareable_link", - "signature": "async def 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 \"models.BastionShareableLinkListResult\":\n", + "signature": "async 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[\"models.BastionShareableLinkListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "_delete_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_delete_bastion_shareable_link_initial", "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", "coroutine": true }, "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" }, - "delete_bastion_shareable_link" : { + "begin_delete_bastion_shareable_link" : { "sync": { - "operation_name": "begin_delete_bastion_shareable_link", "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" }, "async": { - "operation_name": "delete_bastion_shareable_link", - "signature": "async def 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 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", "coroutine": true }, "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:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", @@ -193,11 +185,9 @@ }, "get_bastion_shareable_link" : { "sync": { - "operation_name": "get_bastion_shareable_link", "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" }, "async": { - "operation_name": "get_bastion_shareable_link", "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", "coroutine": false }, @@ -206,37 +196,31 @@ }, "_get_active_sessions_initial" : { "sync": { - "operation_name": "_get_active_sessions_initial", "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" }, "async": { - "operation_name": "_get_active_sessions_initial", - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"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", "coroutine": true }, "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" }, - "get_active_sessions" : { + "begin_get_active_sessions" : { "sync": { - "operation_name": "begin_get_active_sessions", "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" }, "async": { - "operation_name": "get_active_sessions", - "signature": "async def get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"models.BastionActiveSessionListResult\":\n", + "signature": "async def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.BastionActiveSessionListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "disconnect_active_sessions", "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" }, "async": { - "operation_name": "disconnect_active_sessions", "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", "coroutine": false }, @@ -245,11 +229,9 @@ }, "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -258,11 +240,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -271,31 +251,27 @@ }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", "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" }, "async": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", - "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 \"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", "coroutine": true }, "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" }, - "generatevirtualwanvpnserverconfigurationvpnprofile" : { + "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "operation_name": "begin_generatevirtualwanvpnserverconfigurationvpnprofile", "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" }, "async": { - "operation_name": "generatevirtualwanvpnserverconfigurationvpnprofile", - "signature": "async def generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e \"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", "coroutine": true }, - "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: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\"\"\"", + "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:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~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" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.paging import ItemPaged\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.arm_polling import ARMPolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union", - "async_imports": "from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.async_paging import AsyncItemPaged, AsyncList\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"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\": [\"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_03_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_application_gateways_operations_async.py index de134a88432e..3e5c52be6ffd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -542,7 +537,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -561,7 +555,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -574,8 +568,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -641,7 +635,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -660,7 +653,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -673,8 +666,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -719,8 +712,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -744,7 +737,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -769,7 +761,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -784,8 +776,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -835,8 +827,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -862,7 +854,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -892,7 +883,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -910,8 +901,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -986,7 +977,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1035,7 +1025,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1084,7 +1073,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1133,7 +1121,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1181,7 +1168,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1215,6 +1201,10 @@ def list_available_ssl_predefined_policies( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1226,15 +1216,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1296,7 +1282,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_application_security_groups_operations_async.py index 25c3008fa584..14ee4dc081b6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -365,7 +361,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,6 +398,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -414,15 +413,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_delegations_operations_async.py index e17d254c4fe9..096a3d9867fa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_endpoint_services_operations_async.py index 3f139c9a677d..e44dd1399a41 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_private_endpoint_types_operations_async.py index 8a76c0ed20fa..2aed24ecde19 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_private_endpoint_types_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -62,6 +62,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -146,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index 2d9064441e67..a14eb544dd9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_service_aliases_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_service_aliases_operations_async.py index 4db3507b3e9b..10c06ba8068e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_service_aliases_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_available_service_aliases_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -131,6 +131,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index fd1ea3e251c0..94554501c293 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_azure_firewalls_operations_async.py index cd68d4000699..a601a926e122 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -326,8 +322,8 @@ async def _update_tags_initial( azure_firewall_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> Optional["models.AzureFirewall"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( azure_firewall_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -523,6 +518,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -534,15 +533,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_bastion_hosts_operations_async.py index 21420133fde7..9f2861ab2a0d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_bastion_hosts_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('BastionHost', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( bastion_host_name: str, parameters: "models.BastionHost", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_bgp_service_communities_operations_async.py index 16f2f3773550..c0891ec236ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_connection_monitors_operations_async.py index 920e32033939..edd37c5fd2d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -387,7 +383,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -438,7 +433,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -459,7 +453,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -474,8 +468,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -544,7 +538,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -565,7 +558,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -580,8 +573,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -651,7 +644,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -661,7 +653,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -680,7 +671,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -695,8 +686,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -762,6 +753,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -775,15 +770,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ddos_custom_policies_operations_async.py index 5888ab4a22e3..ad47ec2ac3da 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,7 +359,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ddos_protection_plans_operations_async.py index 317e4c9bdaa5..4c3c8947e35e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_default_security_rules_operations_async.py index d0e77a2ea2b2..446aaa517e04 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index 0f803fdf978c..6993d3d79946 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index c85c20651035..8f9b5ba033ce 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index de89c2431484..4eb65dbd5193 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuits_operations_async.py index c57baae9cba5..6042d9562afb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -392,8 +387,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -417,7 +412,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -443,7 +437,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -461,8 +455,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -513,8 +507,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -538,7 +532,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -564,7 +557,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -582,8 +575,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -634,8 +627,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -659,7 +652,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -685,7 +677,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -703,8 +695,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -787,7 +779,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -847,7 +838,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -884,6 +874,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -896,15 +890,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -948,6 +938,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -959,15 +953,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_connections_operations_async.py index 049b754a8d3e..f794ac30579b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index e0062b59ad4b..b37930177771 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_cross_connections_operations_async.py index 468beaf732be..5f98718b20fb 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -392,7 +390,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -420,8 +417,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -445,7 +442,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -471,7 +467,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -489,8 +485,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -541,8 +537,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -566,7 +562,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -592,7 +587,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -610,8 +605,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -662,8 +657,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -687,7 +682,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -713,7 +707,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -731,8 +725,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_gateways_operations_async.py index df1fc0d3b579..e159023bd3f1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_links_operations_async.py index 2c948a344956..14a1b0a8dfe4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_ports_locations_operations_async.py index 4040397ffd07..7d6a371bb459 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_ports_operations_async.py index 53c56cad5e09..e004b928a036 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_service_providers_operations_async.py index 943167b03e0f..b46f8b8e9b96 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_firewall_policies_operations_async.py index c1879309e096..639739cf8ff2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_firewall_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('FirewallPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( firewall_policy_name: str, parameters: "models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": + ) -> AsyncLROPoller["models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: FirewallPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.FirewallPolicy + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.FirewallPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py index a1efe155ba95..933c8fff7798 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_group_name: str, parameters: "models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: FirewallPolicyRuleGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.FirewallPolicyRuleGroup + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.FirewallPolicyRuleGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_flow_logs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_flow_logs_operations_async.py index fcb37c57122e..16bfc01da0ee 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_flow_logs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_flow_logs_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLog') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLog', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( flow_log_name: str, parameters: "models.FlowLog", **kwargs - ) -> "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. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: FlowLog, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.FlowLog + :return: An instance of AsyncLROPoller that returns either FlowLog or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.FlowLog] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified flow log resource. :param resource_group_name: The name of the resource group. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -362,6 +358,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index f5f1f523a8c7..d34e4fbc6e72 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_inbound_nat_rules_operations_async.py index a4d36611309b..d19b3d8f7425 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ip_allocations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ip_allocations_operations_async.py index 9ac64b1bf30e..d5882b645281 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ip_allocations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ip_allocations_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ip_allocation_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified IpAllocation. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpAllocation') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('IpAllocation', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( ip_allocation_name: str, parameters: "models.IpAllocation", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: IpAllocation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.IpAllocation + :return: An instance of AsyncLROPoller that returns either IpAllocation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.IpAllocation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ip_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ip_groups_operations_async.py index 08bab569f3a8..f19b22ee264b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ip_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_ip_groups_operations_async.py @@ -88,7 +88,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -170,7 +167,7 @@ async def begin_create_or_update( ip_groups_name: str, parameters: "models.IpGroup", **kwargs - ) -> "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. @@ -185,8 +182,8 @@ async def begin_create_or_update( 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: IpGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.IpGroup + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.IpGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -273,7 +270,6 @@ async def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -342,7 +337,7 @@ async def begin_delete( resource_group_name: str, ip_groups_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -355,8 +350,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -415,6 +410,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -427,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -491,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index f8aa1eb2be3a..c98b80199449 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 6d298b0bc5c7..57cc3c8ef287 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 50e3b2269375..83279a7af4ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index cf5d22176570..f85888efcef2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 661a9b39b5a4..dcf758d069bf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_probes_operations_async.py index aa41bcb61e17..f3a87e8d5084 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancers_operations_async.py index 26cd1e9f6562..2d3ca923acae 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_local_network_gateways_operations_async.py index 2f26eb628061..018eb517b9bc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_nat_gateways_operations_async.py index d8aa7ea42d9d..69279af9e808 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 112ee59ff608..94eedeae6bb2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index efe6fcca8305..6b4d50a580fd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 64bee1643300..47e5af90f137 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interfaces_operations_async.py index 4c65697ab077..0b186b7763a8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,8 +520,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -548,7 +543,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -572,7 +566,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -585,8 +579,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -633,8 +627,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -656,7 +650,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -680,7 +673,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -693,8 +686,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -763,6 +756,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -777,15 +774,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -835,6 +828,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -848,15 +845,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -935,7 +928,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -984,6 +976,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1001,15 +997,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1092,7 +1084,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_management_client_operations_async.py index 138be663a8c7..c580321d48a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_management_client_operations_async.py @@ -29,8 +29,8 @@ async def _put_bastion_shareable_link_initial( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + ) -> Optional["models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -54,7 +54,6 @@ async def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -83,7 +82,7 @@ async def begin_put_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": + ) -> AsyncLROPoller["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. @@ -98,8 +97,8 @@ async def begin_put_bastion_shareable_link( 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: BastionShareableLinkListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult + :return: An instance of AsyncLROPoller that returns either BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.BastionShareableLinkListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -172,7 +171,6 @@ async def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -196,7 +194,7 @@ async def begin_delete_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> None: + ) -> 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. @@ -211,8 +209,8 @@ async def begin_delete_bastion_shareable_link( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -279,6 +277,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -292,19 +295,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -337,8 +339,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + ) -> Optional["models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -360,7 +362,6 @@ async def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -384,7 +385,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": + ) -> AsyncLROPoller["models.BastionActiveSessionListResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -397,8 +398,8 @@ async def begin_get_active_sessions( 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: BastionActiveSessionListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.BastionActiveSessionListResult + :return: An instance of AsyncLROPoller that returns either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.BastionActiveSessionListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -467,6 +468,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -480,19 +486,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -560,7 +565,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -617,7 +621,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -640,8 +643,8 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -665,7 +668,6 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -694,7 +696,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": + ) -> AsyncLROPoller["models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -712,8 +714,8 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_profiles_operations_async.py index 6cd5f05ffab7..229263fbb6bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_security_groups_operations_async.py index 4aeda409c612..61a89de6e601 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_virtual_appliances_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_virtual_appliances_operations_async.py index b88060258f21..2eba9f8c5c9e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_virtual_appliances_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_virtual_appliances_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_virtual_appliance_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -299,7 +296,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkVirtualAppliance') body_content_kwargs['content'] = body_content @@ -312,7 +308,6 @@ 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('NetworkVirtualAppliance', pipeline_response) @@ -331,7 +326,7 @@ async def begin_create_or_update( network_virtual_appliance_name: str, parameters: "models.NetworkVirtualAppliance", **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> AsyncLROPoller["models.NetworkVirtualAppliance"]: """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -346,8 +341,8 @@ async def begin_create_or_update( 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: NetworkVirtualAppliance, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkVirtualAppliance + :return: An instance of AsyncLROPoller that returns either NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.NetworkVirtualAppliance] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -410,6 +405,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -422,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_watchers_operations_async.py index 7f32fe742e70..415f49ed72c5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "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. @@ -1602,8 +1578,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1677,7 +1653,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1691,7 +1666,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1710,7 +1684,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1726,8 +1700,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1801,7 +1775,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1815,7 +1788,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1834,7 +1806,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "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 @@ -1853,8 +1825,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_operations_async.py index 9123e1bcb7e8..90020d25259b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index 3b59f5ed0ad9..0d173586d562 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -267,7 +264,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -315,7 +311,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -334,7 +329,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -347,8 +342,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,6 +402,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -471,6 +466,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -523,8 +518,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -548,7 +543,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -577,7 +571,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -593,8 +587,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -642,8 +636,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> Optional["models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -665,7 +659,6 @@ async def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -689,7 +682,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -703,8 +696,8 @@ async def begin_get_p2_s_vpn_connection_health( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -752,8 +745,8 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "models.P2SVpnConnectionHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + ) -> Optional["models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -777,7 +770,6 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -806,7 +798,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "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. @@ -822,8 +814,8 @@ async def begin_get_p2_s_vpn_connection_health_detailed( 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: P2SVpnConnectionHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.P2SVpnConnectionHealth + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.P2SVpnConnectionHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -896,7 +888,6 @@ async def _disconnect_p2_s_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -920,7 +911,7 @@ async def begin_disconnect_p2_s_vpn_connections( p2_s_vpn_gateway_name: str, request: "models.P2SVpnConnectionRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. @@ -936,8 +927,8 @@ async def begin_disconnect_p2_s_vpn_connections( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_packet_captures_operations_async.py index dcb57e2db53c..03c234afc218 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index 28ac588db120..60b5949c2575 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_dns_zone_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_dns_zone_groups_operations_async.py index f0a1bcdb4562..210f69e1068f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_dns_zone_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_dns_zone_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private dns zone group. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateDnsZoneGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('PrivateDnsZoneGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( private_dns_zone_group_name: str, parameters: "models.PrivateDnsZoneGroup", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: PrivateDnsZoneGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateDnsZoneGroup + :return: An instance of AsyncLROPoller that returns either PrivateDnsZoneGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.PrivateDnsZoneGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_endpoints_operations_async.py index 6c0b57fc0331..b5946cda669b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, private_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( private_endpoint_name: str, parameters: "models.PrivateEndpoint", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateEndpoint + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.PrivateEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_link_services_operations_async.py index fb5856f67579..98a1d6778dbd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_link_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_private_link_services_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, service_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( service_name: str, parameters: "models.PrivateLinkService", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateLinkService, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateLinkService + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.PrivateLinkService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -509,7 +505,6 @@ async def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -575,7 +570,6 @@ async def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -626,7 +620,6 @@ async def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -647,7 +640,7 @@ async def begin_delete_private_endpoint_connection( service_name: str, pe_connection_name: str, **kwargs - ) -> None: + ) -> 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. @@ -662,8 +655,8 @@ async def begin_delete_private_endpoint_connection( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -726,6 +719,10 @@ def list_private_endpoint_connections( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -739,15 +736,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -775,31 +768,20 @@ async def get_next(next_link=None): ) 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( + async def _check_private_link_service_visibility_initial( self, location: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "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_03_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + ) -> Optional["models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -815,7 +797,6 @@ async def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -824,47 +805,96 @@ async def check_private_link_service_visibility( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - async def check_private_link_service_visibility_by_resource_group( + async def begin_check_private_link_service_visibility( self, location: str, - resource_group_name: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": - """Checks whether the subscription is visible to private link service in the specified resource - group. + ) -> 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 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_03_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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_03_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -881,7 +911,6 @@ async def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -890,17 +919,85 @@ async def check_private_link_service_visibility_by_resource_group( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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_03_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_03_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -923,6 +1020,10 @@ def list_auto_approved_private_link_services( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -935,15 +1036,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -994,6 +1091,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1007,15 +1108,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_public_ip_addresses_operations_async.py index e4cc3cc1f89e..15bf9a1177ef 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -543,6 +538,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -556,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -624,6 +619,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -640,15 +639,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -735,7 +730,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_public_ip_prefixes_operations_async.py index 6f02e828fbfe..8d5032e85ff1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_resource_navigation_links_operations_async.py index 8916869dd377..0167bf41d8c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_filter_rules_operations_async.py index f7c4e4e9a1ec..881741586ce0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list_by_route_filter( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_filters_operations_async.py index 60124cfd7d16..caa2400cc11c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -411,6 +406,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -423,15 +422,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -475,6 +470,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_tables_operations_async.py index 1319fb0a0f2b..20b6832d7a88 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -422,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_routes_operations_async.py index ead3fa825d5e..ee7c6a62ad13 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_security_partner_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_security_partner_providers_operations_async.py index 0e2b79f70d7e..a25b87acd1a3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_security_partner_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_security_partner_providers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, security_partner_provider_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityPartnerProvider') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('SecurityPartnerProvider', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( security_partner_provider_name: str, parameters: "models.SecurityPartnerProvider", **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> AsyncLROPoller["models.SecurityPartnerProvider"]: """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: SecurityPartnerProvider, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProvider + :return: An instance of AsyncLROPoller that returns either SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.SecurityPartnerProvider] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -365,7 +361,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -406,6 +401,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -470,6 +465,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_security_rules_operations_async.py index 3d42f3187b56..a961c1e7d5ec 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_association_links_operations_async.py index 3cfb0a5f7e3b..0311ed19c8d8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_endpoint_policies_operations_async.py index 1794748291b1..ea8576da32af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index d5cde9bbc0b2..e29c05d7128c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_tags_operations_async.py index 9adc288f3030..8d1efeb03e73 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_service_tags_operations_async.py @@ -77,7 +77,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_subnets_operations_async.py index 1a10b1fac662..d52810aaedf1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -490,7 +485,6 @@ async def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -515,7 +509,7 @@ async def begin_unprepare_network_policies( subnet_name: str, unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -533,8 +527,8 @@ async def begin_unprepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -598,6 +592,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -611,15 +609,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_usages_operations_async.py index e5a8c7730e72..adb6b78905b1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py index a748f8222d09..30dadd42b239 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( route_table_name: str, virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: VirtualHubRouteTableV2, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualHubRouteTableV2 + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualHubRouteTableV2] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_hubs_operations_async.py index 1583a5072bcd..69177027f266 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualHub', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index bc7d82207102..0d8e39a0b82c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -330,8 +326,8 @@ async def _update_tags_initial( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> Optional["models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -400,8 +395,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,7 +470,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -488,7 +482,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -507,7 +500,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -525,8 +518,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -610,7 +603,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -648,6 +640,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -660,15 +656,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -701,8 +693,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -726,7 +718,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -755,7 +746,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -774,8 +765,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -824,8 +815,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -849,7 +840,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -882,7 +872,7 @@ async def begin_start_packet_capture( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> 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. @@ -899,8 +889,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -949,8 +939,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -974,7 +964,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1004,7 +993,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> 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. @@ -1021,8 +1010,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_gateways_operations_async.py index ccf04ce08c58..61ae2555324a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -326,8 +322,8 @@ async def _update_tags_initial( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,6 +524,10 @@ def list_connections( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -542,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -583,8 +578,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -608,7 +603,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -633,7 +627,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -649,8 +643,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -720,7 +714,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -739,7 +732,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -753,8 +746,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -799,8 +792,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -824,7 +817,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -853,7 +845,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -870,8 +862,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -920,8 +912,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -945,7 +937,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -974,7 +965,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -991,8 +982,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1040,8 +1031,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1063,7 +1054,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1101,8 +1091,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1150,8 +1140,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1175,7 +1165,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1200,7 +1189,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1215,8 +1204,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1298,7 +1287,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1320,8 +1308,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1343,7 +1331,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1367,7 +1354,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1381,8 +1368,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1430,8 +1417,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1454,7 +1441,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1479,7 +1465,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1495,8 +1481,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1545,8 +1531,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1570,7 +1556,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1599,7 +1584,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1616,8 +1601,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1688,7 +1673,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1710,7 +1694,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1725,8 +1709,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1797,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1840,8 +1823,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1865,7 +1848,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1898,7 +1880,7 @@ async def begin_start_packet_capture( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -1914,8 +1896,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1964,8 +1946,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1989,7 +1971,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2019,7 +2000,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2035,8 +2016,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -2084,8 +2065,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientConnectionHealthDetailListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -2107,7 +2088,6 @@ async def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -2131,7 +2111,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -2145,8 +2125,8 @@ async def begin_get_vpnclient_connection_health( 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: VpnClientConnectionHealthDetailListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnClientConnectionHealthDetailListResult + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnClientConnectionHealthDetailListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2218,7 +2198,6 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -2242,7 +2221,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( virtual_network_gateway_name: str, request: "models.P2SVpnConnectionRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2257,8 +2236,8 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 095d710e4d95..a0822be5a67b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_taps_operations_async.py index 9b646d13cd37..73a797095c9b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_networks_operations_async.py index 0318de8a9b7c..75738053a1ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -563,7 +558,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -603,6 +597,10 @@ def list_usage( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -616,15 +614,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_router_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_router_peerings_operations_async.py index 63fb18c487cc..e340c662de2f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_router_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_router_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -93,7 +92,7 @@ async def begin_delete( virtual_router_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -192,7 +191,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -257,7 +254,6 @@ async def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -277,7 +273,7 @@ async def begin_create_or_update( peering_name: str, parameters: "models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": + ) -> AsyncLROPoller["models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_create_or_update( 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: VirtualRouterPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualRouterPeering + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualRouterPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,6 +359,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_routers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_routers_operations_async.py index c037475f6e9f..b9519750c0e0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_routers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_routers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( virtual_router_name: str, parameters: "models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": + ) -> AsyncLROPoller["models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: VirtualRouter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualRouter + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualRouter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_wans_operations_async.py index 7e026c81097a..22b28bb3c938 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualWAN', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_connections_operations_async.py index e663feba25be..f64791b7b0db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -136,7 +135,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnConnection', pipeline_response) @@ -169,7 +166,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -187,8 +184,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -261,7 +258,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -281,7 +277,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -296,8 +292,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,6 +356,10 @@ def list_by_vpn_gateway( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_gateways_operations_async.py index c3a9c9d03324..e486fd4eaaf9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -266,7 +263,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -314,7 +310,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +328,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -346,8 +341,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -391,8 +386,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> Optional["models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -414,7 +409,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -438,7 +432,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> "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. @@ -451,8 +445,8 @@ async def begin_reset( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -514,6 +508,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -526,15 +524,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -578,6 +572,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_link_connections_operations_async.py index 655214d53941..1e17675c4e49 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -68,6 +68,10 @@ def list_by_vpn_connection( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py index 46d28512d5d1..a782b52be547 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VpnServerConfigurationsResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + ) -> Optional["models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -70,7 +70,6 @@ async def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "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. @@ -108,8 +107,8 @@ async def begin_list( 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: VpnServerConfigurationsResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnServerConfigurationsResponse + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationsResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnServerConfigurationsResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_server_configurations_operations_async.py index 818551e9887d..8d4a2abf04b4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_server_configurations_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_server_configuration_name: str, vpn_server_configuration_parameters: "models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> AsyncLROPoller["models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -269,7 +266,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -317,7 +313,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -336,7 +331,7 @@ async def begin_delete( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -349,8 +344,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -409,6 +404,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -484,15 +483,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_site_link_connections_operations_async.py index 52dbd8d65dcb..b8679cf82915 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_site_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_site_link_connections_operations_async.py @@ -87,7 +87,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_site_links_operations_async.py index b2e38bace683..8d1026a43693 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_site_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list_by_vpn_site( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index e784eb470bd5..7366cc1c1d67 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -96,7 +95,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -112,8 +111,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_sites_operations_async.py index 8595044cd38d..cd37f2e3ba05 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnSite', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_03_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index f1b60baa8188..eac37094a922 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/__init__.py index 2b6958675372..4e1d97b7a07d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/__init__.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/__init__.py @@ -1030,7 +1030,6 @@ ExpressRoutePeeringType, ExpressRoutePortsEncapsulation, FirewallPolicyFilterRuleActionType, - FirewallPolicyIntrusionSystemMode, FirewallPolicyRuleConditionApplicationProtocolType, FirewallPolicyRuleConditionNetworkProtocol, FirewallPolicyRuleConditionType, @@ -1638,7 +1637,6 @@ 'ExpressRoutePeeringType', 'ExpressRoutePortsEncapsulation', 'FirewallPolicyFilterRuleActionType', - 'FirewallPolicyIntrusionSystemMode', 'FirewallPolicyRuleConditionApplicationProtocolType', 'FirewallPolicyRuleConditionNetworkProtocol', 'FirewallPolicyRuleConditionType', diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_models.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_models.py index 13587fb2ce7e..c84a8648e6a9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_models.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_models.py @@ -8398,10 +8398,6 @@ class FirewallPolicy(Resource): "Alert", "Deny", "Off". :type threat_intel_mode: str or ~azure.mgmt.network.v2020_03_01.models.AzureFirewallThreatIntelMode - :param intrusion_system_mode: The operation mode for Intrusion system. Possible values include: - "Enabled", "Disabled". - :type intrusion_system_mode: str or - ~azure.mgmt.network.v2020_03_01.models.FirewallPolicyIntrusionSystemMode """ _validation = { @@ -8427,7 +8423,6 @@ class FirewallPolicy(Resource): 'firewalls': {'key': 'properties.firewalls', 'type': '[SubResource]'}, 'child_policies': {'key': 'properties.childPolicies', 'type': '[SubResource]'}, 'threat_intel_mode': {'key': 'properties.threatIntelMode', 'type': 'str'}, - 'intrusion_system_mode': {'key': 'properties.intrusionSystemMode', 'type': 'str'}, } def __init__( @@ -8442,7 +8437,6 @@ def __init__( self.firewalls = None self.child_policies = None self.threat_intel_mode = kwargs.get('threat_intel_mode', None) - self.intrusion_system_mode = kwargs.get('intrusion_system_mode', None) class FirewallPolicyRule(msrest.serialization.Model): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_models_py3.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_models_py3.py index df52c708af5a..b8b5859192ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_models_py3.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_models_py3.py @@ -9366,10 +9366,6 @@ class FirewallPolicy(Resource): "Alert", "Deny", "Off". :type threat_intel_mode: str or ~azure.mgmt.network.v2020_03_01.models.AzureFirewallThreatIntelMode - :param intrusion_system_mode: The operation mode for Intrusion system. Possible values include: - "Enabled", "Disabled". - :type intrusion_system_mode: str or - ~azure.mgmt.network.v2020_03_01.models.FirewallPolicyIntrusionSystemMode """ _validation = { @@ -9395,7 +9391,6 @@ class FirewallPolicy(Resource): 'firewalls': {'key': 'properties.firewalls', 'type': '[SubResource]'}, 'child_policies': {'key': 'properties.childPolicies', 'type': '[SubResource]'}, 'threat_intel_mode': {'key': 'properties.threatIntelMode', 'type': 'str'}, - 'intrusion_system_mode': {'key': 'properties.intrusionSystemMode', 'type': 'str'}, } def __init__( @@ -9406,7 +9401,6 @@ def __init__( tags: Optional[Dict[str, str]] = None, base_policy: Optional["SubResource"] = None, threat_intel_mode: Optional[Union[str, "AzureFirewallThreatIntelMode"]] = None, - intrusion_system_mode: Optional[Union[str, "FirewallPolicyIntrusionSystemMode"]] = None, **kwargs ): super(FirewallPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) @@ -9417,7 +9411,6 @@ def __init__( self.firewalls = None self.child_policies = None self.threat_intel_mode = threat_intel_mode - self.intrusion_system_mode = intrusion_system_mode class FirewallPolicyRule(msrest.serialization.Model): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_network_management_client_enums.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_network_management_client_enums.py index 4590cfe53689..2100eb5b20af 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_network_management_client_enums.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/models/_network_management_client_enums.py @@ -449,13 +449,6 @@ class FirewallPolicyFilterRuleActionType(str, Enum): allow = "Allow" deny = "Deny" -class FirewallPolicyIntrusionSystemMode(str, Enum): - """The operation mode for Intrusion system mode. - """ - - enabled = "Enabled" - disabled = "Disabled" - class FirewallPolicyRuleConditionApplicationProtocolType(str, Enum): """The application protocol type of a Rule condition. """ 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 1d1ea43eca9a..66287e4fb170 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -555,7 +550,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -575,7 +569,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -656,7 +650,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +669,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -736,8 +729,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -761,7 +754,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -787,7 +779,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -854,8 +846,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -881,7 +873,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -912,7 +903,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1007,7 +998,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,7 +1047,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1107,7 +1096,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1157,7 +1145,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1206,7 +1193,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1241,6 +1227,10 @@ def list_available_ssl_predefined_policies( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1252,15 +1242,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1323,7 +1309,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 07a670515b3c..54d1609a1e56 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -375,7 +371,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -414,6 +409,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -425,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -493,15 +492,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d3c9dfba7911..b0fa2a9acdb3 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 @@ -66,6 +66,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 99bae985c37c..6981a6d32f05 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 @@ -66,6 +66,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aa41aee4ebba..02591b923c67 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 @@ -67,6 +67,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,6 +139,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -152,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9227e236a19b..96b386203b18 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e94fe02049c4..42da95d5f77d 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 @@ -66,6 +66,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -137,6 +137,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -150,15 +154,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0ee2e263a147..d88a9b95b6a5 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0d0913511372..b3f05f15cd17 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> Optional["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -536,6 +531,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -547,15 +546,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dddcff63ac0c..91ece86da029 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('BastionHost', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 da88795fd5a3..df2e3073f313 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 @@ -63,6 +63,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4ebb6f307a1d..024a90b26c3a 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -397,7 +393,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -449,7 +444,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -471,7 +465,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -557,7 +551,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -579,7 +572,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -666,7 +659,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +668,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -696,7 +687,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -779,6 +770,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -792,15 +787,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d4e28ae5a1b6..6f0a0c22257d 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -373,7 +369,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content 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 283c92d15825..e6ba08587159 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f480fddfe607..1d120605a705 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c32e74d269a4..c4f164616b9f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4f700d821969..334fd006f093 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 afb1d69cbe2d..525a16c6b80e 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e82e5d6252a8..69636555e11f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,8 +398,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -428,7 +423,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +449,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -526,8 +520,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -551,7 +545,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -578,7 +571,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -649,8 +642,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -674,7 +667,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -701,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -804,7 +796,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -865,7 +856,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -903,6 +893,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -915,15 +909,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -968,6 +958,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -979,15 +973,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ec1fe572e27a..a233ca0c3c94 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 2b9a74252088..6545baba219b 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 @@ -71,6 +71,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 0bc3a69aa5ca..c56999134f30 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 @@ -65,6 +65,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -402,7 +400,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -431,8 +428,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -456,7 +453,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,7 +479,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -554,8 +550,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -579,7 +575,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -606,7 +601,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -677,8 +672,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -702,7 +697,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +723,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 eef8c1df6727..eb1e2071c676 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 57a18888138a..1325fee1cd2a 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 82ee43a44240..4e702af9f26f 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 @@ -65,6 +65,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c78557d6e014..9184ef1a032a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cc32f8817087..472ec09f7d4d 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 @@ -63,6 +63,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 58b086dc5daa..bf3a40601112 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('FirewallPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -355,6 +351,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e19f52a89fe2..5bcac1e9d4b7 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 fcd8c8e0b81f..7892d99c4541 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLog') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLog', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified flow log resource. :param resource_group_name: The name of the resource group. @@ -372,6 +368,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -385,15 +385,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 803bb770cabd..d83a0e81b3f3 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7f3069c51c00..ba058f09a828 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 @@ -71,6 +71,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 b8bc9e0748b8..e6c1efb54dfb 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ip_allocation_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified IpAllocation. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpAllocation') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('IpAllocation', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.IpAllocation"] """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 204485c9190d..b479475b90cc 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 @@ -93,7 +93,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -177,7 +174,7 @@ def begin_create_or_update( parameters, # type: "models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -281,7 +278,6 @@ def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -331,7 +327,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -352,7 +347,7 @@ def begin_delete( ip_groups_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -426,6 +421,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -438,15 +437,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -492,6 +487,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -503,15 +502,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 10df6ed5976f..b65fdf704cb9 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 dca46a6f8a4a..ec3730b9e3ba 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 7c8a256a1125..aedb0489ac46 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 5ea111c43fd0..fe0f2cc868e0 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 64e32e5ca54c..bd3f18094a02 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 2d42610abc96..d5f7cbe4dd94 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 1f2aa5769d80..87120b067fbe 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8ecab1bdd7ed..6c30ee48bbce 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 72e847ad2b77..a248549ffc03 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a0d3e8be2b62..c690bd01bf3d 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 99ff3de201bd..71b4832ada0b 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0f6510a5a2fb..c60b54505456 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 21046e9f879e..ea5653121b9b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,8 +533,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -561,7 +556,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -586,7 +580,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -648,8 +642,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -671,7 +665,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -696,7 +689,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -780,6 +773,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -794,15 +791,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -853,6 +846,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -866,15 +863,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -954,7 +947,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1004,6 +996,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1021,15 +1017,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1113,7 +1105,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 95c53e4b6ead..37cd06f70e7c 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 @@ -34,8 +34,8 @@ def _put_bastion_shareable_link_initial( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> "models.BastionShareableLinkListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + # type: (...) -> Optional["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -59,7 +59,6 @@ def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -89,7 +88,7 @@ def begin_put_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["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. @@ -179,7 +178,6 @@ def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -204,7 +202,7 @@ def begin_delete_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -288,6 +286,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -301,19 +304,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -347,8 +349,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionActiveSessionListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + # type: (...) -> Optional["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -370,7 +372,6 @@ def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +396,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionActiveSessionListResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -479,6 +480,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -492,19 +498,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -573,7 +578,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +635,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -655,8 +658,8 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -680,7 +683,6 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -710,7 +712,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. 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 3dc4d83a7c11..4735d068deed 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5dda5d764260..2cf161a43462 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 de98e850dae0..d30fdc47cc20 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_virtual_appliance_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -308,7 +305,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkVirtualAppliance') body_content_kwargs['content'] = body_content @@ -321,7 +317,6 @@ 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('NetworkVirtualAppliance', pipeline_response) @@ -341,7 +336,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkVirtualAppliance"] """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -421,6 +416,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ae521f63a751..4cf8192b2d26 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1708,7 +1684,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1722,7 +1697,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1742,7 +1716,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1834,7 +1808,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1848,7 +1821,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1868,7 +1840,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 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 10925e7227a0..dcf9e353cfaa 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 @@ -63,6 +63,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 16f6ecb966eb..f520355a8d14 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -275,7 +272,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -324,7 +320,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -344,7 +339,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,6 +413,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -483,6 +478,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -494,15 +493,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -536,8 +531,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -561,7 +556,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -591,7 +585,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -657,8 +651,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> Optional["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -680,7 +674,6 @@ def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -705,7 +698,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -769,8 +762,8 @@ def _get_p2_s_vpn_connection_health_detailed_initial( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnConnectionHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + # type: (...) -> Optional["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -794,7 +787,6 @@ def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -824,7 +816,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -915,7 +907,6 @@ def _disconnect_p2_s_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -940,7 +931,7 @@ def begin_disconnect_p2_s_vpn_connections( request, # type: "models.P2SVpnConnectionRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. 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 4ed64f0631a8..a7c1d62c0b69 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5c791112ca52..e1bedd70842f 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 613d2b37681d..da75588c64ab 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( private_dns_zone_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private dns zone group. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateDnsZoneGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('PrivateDnsZoneGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 905d9de9e6af..a82f51d99b61 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( private_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4275393e7ec1..b62cc584c315 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -521,7 +517,6 @@ def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -588,7 +583,6 @@ def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -640,7 +634,6 @@ def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -662,7 +655,7 @@ def begin_delete_private_endpoint_connection( pe_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -742,6 +735,10 @@ def list_private_endpoint_connections( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -755,15 +752,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -791,32 +784,21 @@ def get_next(next_link=None): ) list_private_endpoint_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections'} # type: ignore - def check_private_link_service_visibility( + def _check_private_link_service_visibility_initial( self, location, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "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_03_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -832,7 +814,6 @@ def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -841,48 +822,98 @@ def check_private_link_service_visibility( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - def check_private_link_service_visibility_by_resource_group( + def begin_check_private_link_service_visibility( self, location, # type: str - resource_group_name, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" - """Checks whether the subscription is visible to private link service in the specified resource - group. + # 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 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_03_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_03_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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_03_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -899,7 +930,6 @@ def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -908,17 +938,86 @@ def check_private_link_service_visibility_by_resource_group( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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_03_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_03_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -942,6 +1041,10 @@ def list_auto_approved_private_link_services( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -954,15 +1057,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1014,6 +1113,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1027,15 +1130,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 06085422d658..b76ef3656bd0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -556,6 +551,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -569,15 +568,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -638,6 +633,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -654,15 +653,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -750,7 +745,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 cc82c59a653d..878eede9508c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f0fd9c66f701..eb674be358e2 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 7ec086af49c8..2d600c4f00d2 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list_by_route_filter( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 0a30eb3cd481..5ef51b58e702 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -422,6 +417,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -434,15 +433,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -487,6 +482,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8523e2c4db90..b37ec4e09682 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 66f36dba6c03..e90a3bb8f6db 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8171a2c58a15..46a2c210e2c8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( security_partner_provider_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityPartnerProvider') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('SecurityPartnerProvider', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.SecurityPartnerProvider"] """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -375,7 +371,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -417,6 +412,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -482,6 +477,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -493,15 +492,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d990da237acc..a3c803c6483d 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2607c7ba3442..2f1fba4cbd9d 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 80a3c6d3ad34..9d596d0f1063 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 70ec099ea7ac..9ae32b71bd3c 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b0f1f00e318f..acb80a8b3a5b 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 @@ -82,7 +82,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 8102547a19d7..c9021add5a46 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -502,7 +497,6 @@ def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -528,7 +522,7 @@ def begin_unprepare_network_policies( unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -612,6 +606,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -625,15 +623,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4ba5260473ea..d3df764a86f6 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 @@ -66,6 +66,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f8d229448a0e..4388fbf85bac 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -374,6 +370,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 c4bec069343e..20f00ac61dda 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualHub', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 513c7489b781..c02df41d4c0e 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -340,8 +336,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -487,7 +482,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -500,7 +494,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -520,7 +513,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -624,7 +617,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,6 +655,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -675,15 +671,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -717,8 +709,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -742,7 +734,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -772,7 +763,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -842,8 +833,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -867,7 +858,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -901,7 +891,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -969,8 +959,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -994,7 +984,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1025,7 +1014,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 db8989de8212..cd728b2198c3 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,6 +537,10 @@ def list_connections( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -555,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -597,8 +592,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -622,7 +617,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -648,7 +642,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -736,7 +730,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -756,7 +749,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -817,8 +810,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -842,7 +835,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -940,8 +932,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -965,7 +957,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -995,7 +986,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1062,8 +1053,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1085,7 +1076,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1174,8 +1164,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1199,7 +1189,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1225,7 +1214,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1324,7 +1313,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1347,8 +1335,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1370,7 +1358,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1395,7 +1382,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1459,8 +1446,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1483,7 +1470,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1509,7 +1495,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1576,8 +1562,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1601,7 +1587,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1631,7 +1616,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1721,7 +1706,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1744,7 +1728,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1848,7 +1832,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1876,8 +1859,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -1901,7 +1884,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1935,7 +1917,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2002,8 +1984,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -2027,7 +2009,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2058,7 +2039,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2124,8 +2105,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientConnectionHealthDetailListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -2147,7 +2128,6 @@ def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2172,7 +2152,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2260,7 +2240,6 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -2285,7 +2264,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( request, # type: "models.P2SVpnConnectionRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 901bb733b913..6bee3d8844b5 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 764d455ad4a7..90752a71d556 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 194f63c7857c..9be3507adc9e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -576,7 +571,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -617,6 +611,10 @@ def list_usage( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -630,15 +628,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dfca240b9e75..688416fbddb9 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +98,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -199,7 +198,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -265,7 +262,6 @@ def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -286,7 +282,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -373,6 +369,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 007d89036736..d7533ad1822f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -358,6 +354,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 26d467a9d0d9..81e9cde92d1d 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualWAN', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b15799d5c685..9e32f2ec7317 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -142,7 +141,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -155,7 +153,6 @@ 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('VpnConnection', pipeline_response) @@ -176,7 +173,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -269,7 +266,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -290,7 +286,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -370,6 +366,10 @@ def list_by_vpn_gateway( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 79ed459aeb36..97698250ceea 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -274,7 +271,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -323,7 +319,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +338,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -402,8 +397,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> Optional["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -425,7 +420,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -450,7 +444,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -527,6 +521,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -539,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -592,6 +586,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6e6148891a95..8ebf86ea0b9f 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 @@ -73,6 +73,10 @@ def list_by_vpn_connection( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -87,15 +91,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e432fac9cbd1..1c009ae362be 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 @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfigurationsResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-03-01" @@ -75,7 +75,6 @@ def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 a3999599d692..7ae190cdecb7 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -277,7 +274,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -326,7 +322,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -346,7 +341,7 @@ def begin_delete( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,6 +415,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -496,15 +495,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 2410141a4d4b..9c3c9785f9d9 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 @@ -92,7 +92,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c1cc2343e2af..c50572532b5a 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list_by_vpn_site( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 aa502545f319..d9e6beee45be 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -102,7 +101,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 44ff02750f1b..991022000efa 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnSite', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 09627bb93a51..8f46ffc09e21 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 @@ -68,6 +68,10 @@ def list( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2020-03-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. 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 f1b7671c960f..a54ef9c13686 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 @@ -142,51 +142,43 @@ "operation_mixins": { "_put_bastion_shareable_link_initial" : { "sync": { - "operation_name": "_put_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_put_bastion_shareable_link_initial", - "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 \"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", "coroutine": true }, "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" }, - "put_bastion_shareable_link" : { + "begin_put_bastion_shareable_link" : { "sync": { - "operation_name": "begin_put_bastion_shareable_link", "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" }, "async": { - "operation_name": "put_bastion_shareable_link", - "signature": "async def 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 \"models.BastionShareableLinkListResult\":\n", + "signature": "async 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[\"models.BastionShareableLinkListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "_delete_bastion_shareable_link_initial", "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" }, "async": { - "operation_name": "_delete_bastion_shareable_link_initial", "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", "coroutine": true }, "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" }, - "delete_bastion_shareable_link" : { + "begin_delete_bastion_shareable_link" : { "sync": { - "operation_name": "begin_delete_bastion_shareable_link", "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" }, "async": { - "operation_name": "delete_bastion_shareable_link", - "signature": "async def 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 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", "coroutine": true }, "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:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", @@ -194,11 +186,9 @@ }, "get_bastion_shareable_link" : { "sync": { - "operation_name": "get_bastion_shareable_link", "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" }, "async": { - "operation_name": "get_bastion_shareable_link", "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", "coroutine": false }, @@ -207,37 +197,31 @@ }, "_get_active_sessions_initial" : { "sync": { - "operation_name": "_get_active_sessions_initial", "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" }, "async": { - "operation_name": "_get_active_sessions_initial", - "signature": "async def _get_active_sessions_initial(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"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", "coroutine": true }, "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" }, - "get_active_sessions" : { + "begin_get_active_sessions" : { "sync": { - "operation_name": "begin_get_active_sessions", "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" }, "async": { - "operation_name": "get_active_sessions", - "signature": "async def get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e \"models.BastionActiveSessionListResult\":\n", + "signature": "async def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.BastionActiveSessionListResult\"]:\n", "coroutine": true }, - "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: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\"\"\"", + "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:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~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": { - "operation_name": "disconnect_active_sessions", "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" }, "async": { - "operation_name": "disconnect_active_sessions", "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", "coroutine": false }, @@ -246,11 +230,9 @@ }, "check_dns_name_availability" : { "sync": { - "operation_name": "check_dns_name_availability", "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "check_dns_name_availability", "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", "coroutine": true }, @@ -259,11 +241,9 @@ }, "supported_security_providers" : { "sync": { - "operation_name": "supported_security_providers", "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" }, "async": { - "operation_name": "supported_security_providers", "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", "coroutine": true }, @@ -272,31 +252,27 @@ }, "_generatevirtualwanvpnserverconfigurationvpnprofile_initial" : { "sync": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", "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" }, "async": { - "operation_name": "_generatevirtualwanvpnserverconfigurationvpnprofile_initial", - "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 \"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", "coroutine": true }, "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" }, - "generatevirtualwanvpnserverconfigurationvpnprofile" : { + "begin_generatevirtualwanvpnserverconfigurationvpnprofile" : { "sync": { - "operation_name": "begin_generatevirtualwanvpnserverconfigurationvpnprofile", "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" }, "async": { - "operation_name": "generatevirtualwanvpnserverconfigurationvpnprofile", - "signature": "async def generatevirtualwanvpnserverconfigurationvpnprofile(\n self,\n resource_group_name: str,\n virtual_wan_name: str,\n vpn_client_params: \"models.VirtualWanVpnProfileParameters\",\n **kwargs\n) -\u003e \"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", "coroutine": true }, - "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: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\"\"\"", + "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:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~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" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.paging import ItemPaged\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.arm_polling import ARMPolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union", - "async_imports": "from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.async_paging import AsyncItemPaged, AsyncList\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\nfrom azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"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\": [\"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_04_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_application_gateways_operations_async.py index 8b64990d14db..97e945af052f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_application_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_application_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationGateway', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_gateway_name: str, parameters: "models.ApplicationGateway", **kwargs - ) -> "models.ApplicationGateway": + ) -> AsyncLROPoller["models.ApplicationGateway"]: """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGateway + :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ApplicationGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -542,7 +537,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -561,7 +555,7 @@ async def begin_start( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -574,8 +568,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -641,7 +635,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -660,7 +653,7 @@ async def begin_stop( resource_group_name: str, application_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -673,8 +666,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -719,8 +712,8 @@ async def _backend_health_initial( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + ) -> Optional["models.ApplicationGatewayBackendHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -744,7 +737,6 @@ async def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -769,7 +761,7 @@ async def begin_backend_health( application_gateway_name: str, expand: Optional[str] = None, **kwargs - ) -> "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. @@ -784,8 +776,8 @@ async def begin_backend_health( 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: ApplicationGatewayBackendHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayBackendHealth + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayBackendHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -835,8 +827,8 @@ async def _backend_health_on_demand_initial( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "models.ApplicationGatewayBackendHealthOnDemand": - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + ) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -862,7 +854,6 @@ async def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -892,7 +883,7 @@ async def begin_backend_health_on_demand( probe_request: "models.ApplicationGatewayOnDemandProbe", expand: Optional[str] = None, **kwargs - ) -> "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. @@ -910,8 +901,8 @@ async def begin_backend_health_on_demand( 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: ApplicationGatewayBackendHealthOnDemand, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayBackendHealthOnDemand + :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealthOnDemand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ApplicationGatewayBackendHealthOnDemand] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -986,7 +977,6 @@ async def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1035,7 +1025,6 @@ async def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1084,7 +1073,6 @@ async def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1133,7 +1121,6 @@ async def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1181,7 +1168,6 @@ async def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1215,6 +1201,10 @@ def list_available_ssl_predefined_policies( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1226,15 +1216,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1296,7 +1282,6 @@ async def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_application_security_groups_operations_async.py index 291cc35aaf0f..3c6810dd9e08 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_application_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_application_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, application_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( application_security_group_name: str, parameters: "models.ApplicationSecurityGroup", **kwargs - ) -> "models.ApplicationSecurityGroup": + ) -> AsyncLROPoller["models.ApplicationSecurityGroup"]: """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: ApplicationSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroup + :return: An instance of AsyncLROPoller that returns either ApplicationSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ApplicationSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -365,7 +361,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,6 +398,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -414,15 +413,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_delegations_operations_async.py index bdd446938f22..b55ae4362b60 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_delegations_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_endpoint_services_operations_async.py index 5b0b1d3e362e..8e5d258f5aa9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_endpoint_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_endpoint_services_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_private_endpoint_types_operations_async.py index 9209f156263e..51c72e90adb2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_private_endpoint_types_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -62,6 +62,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -146,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_resource_group_delegations_operations_async.py index c0f970141bc0..e5ce821b6f2b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_resource_group_delegations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_resource_group_delegations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_service_aliases_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_service_aliases_operations_async.py index 42942b976d62..2e3b25b38770 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_service_aliases_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_available_service_aliases_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -131,6 +131,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py index 6f8f5cac2092..543658cfe813 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -58,6 +58,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_azure_firewalls_operations_async.py index 780c5f1da4eb..a4b61a4ffa9c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_azure_firewalls_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, azure_firewall_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('AzureFirewall', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( azure_firewall_name: str, parameters: "models.AzureFirewall", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -326,8 +322,8 @@ async def _update_tags_initial( azure_firewall_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.AzureFirewall": - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + ) -> Optional["models.AzureFirewall"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( azure_firewall_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.AzureFirewall": + ) -> AsyncLROPoller["models.AzureFirewall"]: """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: AzureFirewall, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.AzureFirewall + :return: An instance of AsyncLROPoller that returns either AzureFirewall or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.AzureFirewall] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -523,6 +518,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -534,15 +533,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_bastion_hosts_operations_async.py index 7225f5672c5e..f025970ff5cc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_bastion_hosts_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('BastionHost', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( bastion_host_name: str, parameters: "models.BastionHost", **kwargs - ) -> "models.BastionHost": + ) -> AsyncLROPoller["models.BastionHost"]: """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: BastionHost, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionHost + :return: An instance of AsyncLROPoller that returns either BastionHost or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.BastionHost] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -337,6 +333,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -348,15 +348,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -403,6 +399,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -415,15 +415,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_bgp_service_communities_operations_async.py index 72a518d1c626..284d8487c554 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_bgp_service_communities_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_connection_monitors_operations_async.py index 0036990f4a1f..b5199b96e1c9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_connection_monitors_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_connection_monitors_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( connection_monitor_name: str, parameters: "models.ConnectionMonitor", **kwargs - ) -> "models.ConnectionMonitorResult": + ) -> AsyncLROPoller["models.ConnectionMonitorResult"]: """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: ConnectionMonitorResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -387,7 +383,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -438,7 +433,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -459,7 +453,7 @@ async def begin_stop( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -474,8 +468,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -544,7 +538,6 @@ async def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -565,7 +558,7 @@ async def begin_start( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -580,8 +573,8 @@ async def begin_start( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -651,7 +644,6 @@ async def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -661,7 +653,6 @@ async def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -680,7 +671,7 @@ async def begin_query( network_watcher_name: str, connection_monitor_name: str, **kwargs - ) -> "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. @@ -695,8 +686,8 @@ async def begin_query( 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: ConnectionMonitorQueryResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorQueryResult + :return: An instance of AsyncLROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ConnectionMonitorQueryResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -762,6 +753,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -775,15 +770,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ddos_custom_policies_operations_async.py index 46eaff275dc8..01ec0de2719a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ddos_custom_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -69,7 +69,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -88,7 +87,7 @@ async def begin_delete( resource_group_name: str, ddos_custom_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -101,8 +100,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -180,7 +179,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -228,7 +226,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -241,7 +238,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -260,7 +256,7 @@ async def begin_create_or_update( ddos_custom_policy_name: str, parameters: "models.DdosCustomPolicy", **kwargs - ) -> "models.DdosCustomPolicy": + ) -> AsyncLROPoller["models.DdosCustomPolicy"]: """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -275,8 +271,8 @@ async def begin_create_or_update( 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: DdosCustomPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosCustomPolicy + :return: An instance of AsyncLROPoller that returns either DdosCustomPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.DdosCustomPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,7 +359,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py index 5d4c7fb24f5e..a62921a11bf7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ddos_protection_plan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( ddos_protection_plan_name: str, parameters: "models.DdosProtectionPlan", **kwargs - ) -> "models.DdosProtectionPlan": + ) -> AsyncLROPoller["models.DdosProtectionPlan"]: """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: DdosProtectionPlan, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlan + :return: An instance of AsyncLROPoller that returns either DdosProtectionPlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.DdosProtectionPlan] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_default_security_rules_operations_async.py index 920eeac8961e..73a13cd8bccf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_default_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_default_security_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py index cbf22c8457b0..f5c585fb4a4c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, authorization_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( authorization_name: str, authorization_parameters: "models.ExpressRouteCircuitAuthorization", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitAuthorization + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitAuthorization] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py index b640c6f570e9..d205dc00ae1b 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -74,7 +74,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -95,7 +94,7 @@ async def begin_delete( peering_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -113,8 +112,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -202,7 +201,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -254,7 +252,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -288,7 +284,7 @@ async def begin_create_or_update( connection_name: str, express_route_circuit_connection_parameters: "models.ExpressRouteCircuitConnection", **kwargs - ) -> "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. @@ -308,8 +304,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -381,6 +377,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -395,15 +395,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py index 72dbb8d6d54d..ae0e9c06e7d4 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( circuit_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCircuitPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuits_operations_async.py index dea49607b8b4..6b3305199fdf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuits_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, circuit_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( circuit_name: str, parameters: "models.ExpressRouteCircuit", **kwargs - ) -> "models.ExpressRouteCircuit": + ) -> AsyncLROPoller["models.ExpressRouteCircuit"]: """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuit + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuit] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -392,8 +387,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -417,7 +412,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -443,7 +437,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -461,8 +455,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -513,8 +507,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -538,7 +532,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -564,7 +557,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -582,8 +575,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -634,8 +627,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -659,7 +652,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -685,7 +677,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -703,8 +695,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCircuitsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -787,7 +779,6 @@ async def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -847,7 +838,6 @@ async def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -884,6 +874,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -896,15 +890,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -948,6 +938,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -959,15 +953,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_connections_operations_async.py index d21df57606e4..02f652c084d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_connections_operations_async.py @@ -75,7 +75,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -88,7 +87,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -108,7 +106,7 @@ async def begin_create_or_update( connection_name: str, put_express_route_connection_parameters: "models.ExpressRouteConnection", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: ExpressRouteConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( express_route_gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -375,7 +371,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py index b858419c4482..80056b6d9155 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( cross_connection_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -262,7 +261,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -312,7 +310,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -325,7 +322,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -345,7 +341,7 @@ async def begin_create_or_update( peering_name: str, peering_parameters: "models.ExpressRouteCrossConnectionPeering", **kwargs - ) -> "models.ExpressRouteCrossConnectionPeering": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionPeering"]: """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -363,8 +359,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnectionPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionPeering + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py index e138a2ab3374..c7fc2d5bbc6d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -126,6 +126,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -213,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -261,7 +260,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -288,7 +286,7 @@ async def begin_create_or_update( cross_connection_name: str, parameters: "models.ExpressRouteCrossConnection", **kwargs - ) -> "models.ExpressRouteCrossConnection": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnection"]: """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -303,8 +301,8 @@ async def begin_create_or_update( 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: ExpressRouteCrossConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnection + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -392,7 +390,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -420,8 +417,8 @@ async def _list_arp_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsArpTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -445,7 +442,6 @@ async def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -471,7 +467,7 @@ async def begin_list_arp_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsArpTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsArpTableListResult"]: """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -489,8 +485,8 @@ async def begin_list_arp_table( 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: ExpressRouteCircuitsArpTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsArpTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsArpTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -541,8 +537,8 @@ async def _list_routes_table_summary_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + ) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -566,7 +562,6 @@ async def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -592,7 +587,7 @@ async def begin_list_routes_table_summary( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult": + ) -> AsyncLROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]: """Gets the route table summary associated with the express route cross connection in a resource group. @@ -610,8 +605,8 @@ async def begin_list_routes_table_summary( 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: ExpressRouteCrossConnectionsRoutesTableSummaryListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCrossConnectionsRoutesTableSummaryListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -662,8 +657,8 @@ async def _list_routes_table_initial( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + ) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -687,7 +682,6 @@ async def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -713,7 +707,7 @@ async def begin_list_routes_table( peering_name: str, device_path: str, **kwargs - ) -> "models.ExpressRouteCircuitsRoutesTableListResult": + ) -> AsyncLROPoller["models.ExpressRouteCircuitsRoutesTableListResult"]: """Gets the currently advertised routes table associated with the express route cross connection in a resource group. @@ -731,8 +725,8 @@ async def begin_list_routes_table( 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: ExpressRouteCircuitsRoutesTableListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsRoutesTableListResult + :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteCircuitsRoutesTableListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_gateways_operations_async.py index a81c48608194..d67d804dc997 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_gateways_operations_async.py @@ -73,7 +73,6 @@ async def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -125,7 +124,6 @@ async def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -173,7 +171,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -186,7 +183,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -205,7 +201,7 @@ async def begin_create_or_update( express_route_gateway_name: str, put_express_route_gateway_parameters: "models.ExpressRouteGateway", **kwargs - ) -> "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. @@ -221,8 +217,8 @@ async def begin_create_or_update( 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: ExpressRouteGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRouteGateway + :return: An instance of AsyncLROPoller that returns either ExpressRouteGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRouteGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -304,7 +300,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -348,7 +343,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -367,7 +361,7 @@ async def begin_delete( resource_group_name: str, express_route_gateway_name: str, **kwargs - ) -> None: + ) -> 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. @@ -381,8 +375,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_links_operations_async.py index 3b56552bdefe..57e379ca1710 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_locations_operations_async.py index df02b6b2b313..9be42b09c22d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_locations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -60,6 +60,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +75,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -142,7 +142,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_operations_async.py index 02e5dd72267b..8519ba87fdfc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, express_route_port_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( express_route_port_name: str, parameters: "models.ExpressRoutePort", **kwargs - ) -> "models.ExpressRoutePort": + ) -> AsyncLROPoller["models.ExpressRoutePort"]: """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: ExpressRoutePort, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ExpressRoutePort + :return: An instance of AsyncLROPoller that returns either ExpressRoutePort or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ExpressRoutePort] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_service_providers_operations_async.py index bf2f2b0882cd..7256894519fc 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_service_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -69,15 +73,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_firewall_policies_operations_async.py index 17f845e07c9b..6bd4b1360f59 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_firewall_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, firewall_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('FirewallPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( firewall_policy_name: str, parameters: "models.FirewallPolicy", **kwargs - ) -> "models.FirewallPolicy": + ) -> AsyncLROPoller["models.FirewallPolicy"]: """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: FirewallPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.FirewallPolicy + :return: An instance of AsyncLROPoller that returns either FirewallPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.FirewallPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -345,6 +341,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -357,15 +357,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -409,6 +405,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -420,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py index e415c72aba36..8667dc42a717 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_firewall_policy_rule_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( firewall_policy_name: str, rule_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_group_name: str, parameters: "models.FirewallPolicyRuleGroup", **kwargs - ) -> "models.FirewallPolicyRuleGroup": + ) -> AsyncLROPoller["models.FirewallPolicyRuleGroup"]: """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: FirewallPolicyRuleGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.FirewallPolicyRuleGroup + :return: An instance of AsyncLROPoller that returns either FirewallPolicyRuleGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyRuleGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_flow_logs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_flow_logs_operations_async.py index d204f99cd015..cbb6dedea97a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_flow_logs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_flow_logs_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLog') body_content_kwargs['content'] = body_content @@ -90,7 +89,6 @@ async def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLog', pipeline_response) @@ -110,7 +108,7 @@ async def begin_create_or_update( flow_log_name: str, parameters: "models.FlowLog", **kwargs - ) -> "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. @@ -127,8 +125,8 @@ async def begin_create_or_update( 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: FlowLog, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.FlowLog + :return: An instance of AsyncLROPoller that returns either FlowLog or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.FlowLog] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -215,7 +213,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -262,7 +259,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -283,7 +279,7 @@ async def begin_delete( network_watcher_name: str, flow_log_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified flow log resource. :param resource_group_name: The name of the resource group. @@ -298,8 +294,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -362,6 +358,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -375,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_hub_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_hub_route_tables_operations_async.py index 1705fb880dd9..7199030deb0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_hub_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_hub_route_tables_operations_async.py @@ -76,7 +76,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_table_parameters, 'HubRouteTable') body_content_kwargs['content'] = body_content @@ -89,7 +88,6 @@ 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('HubRouteTable', pipeline_response) @@ -109,7 +107,7 @@ async def begin_create_or_update( route_table_name: str, route_table_parameters: "models.HubRouteTable", **kwargs - ) -> "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. @@ -126,8 +124,8 @@ async def begin_create_or_update( 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: HubRouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.HubRouteTable + :return: An instance of AsyncLROPoller that returns either HubRouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.HubRouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -214,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -260,7 +257,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -280,7 +276,7 @@ async def begin_delete( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a RouteTable. :param resource_group_name: The resource group name of the RouteTable. @@ -295,8 +291,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -359,6 +355,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py index 3b51356b4988..0687c8adb23e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py index 055fc96a86f6..545e9e0305aa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -143,7 +143,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -163,7 +162,7 @@ async def begin_delete( load_balancer_name: str, inbound_nat_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -178,8 +177,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -267,7 +266,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -317,7 +315,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -330,7 +327,6 @@ 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('InboundNatRule', pipeline_response) @@ -350,7 +346,7 @@ async def begin_create_or_update( inbound_nat_rule_name: str, inbound_nat_rule_parameters: "models.InboundNatRule", **kwargs - ) -> "models.InboundNatRule": + ) -> AsyncLROPoller["models.InboundNatRule"]: """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -368,8 +364,8 @@ async def begin_create_or_update( 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: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.InboundNatRule + :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.InboundNatRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ip_allocations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ip_allocations_operations_async.py index 3217f305f059..55e3535e232d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ip_allocations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ip_allocations_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, ip_allocation_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified IpAllocation. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpAllocation') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('IpAllocation', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( ip_allocation_name: str, parameters: "models.IpAllocation", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: IpAllocation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.IpAllocation + :return: An instance of AsyncLROPoller that returns either IpAllocation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.IpAllocation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ip_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ip_groups_operations_async.py index 8475a9424d5f..2791e24f6304 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ip_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_ip_groups_operations_async.py @@ -88,7 +88,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -170,7 +167,7 @@ async def begin_create_or_update( ip_groups_name: str, parameters: "models.IpGroup", **kwargs - ) -> "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. @@ -185,8 +182,8 @@ async def begin_create_or_update( 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: IpGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.IpGroup + :return: An instance of AsyncLROPoller that returns either IpGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.IpGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -273,7 +270,6 @@ async def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -342,7 +337,7 @@ async def begin_delete( resource_group_name: str, ip_groups_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -355,8 +350,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -415,6 +410,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -427,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -491,15 +490,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py index fcc7c04bca58..4e9b68c719b0 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -66,6 +66,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -157,7 +157,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -207,7 +206,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BackendAddressPool') body_content_kwargs['content'] = body_content @@ -220,7 +218,6 @@ 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('BackendAddressPool', pipeline_response) @@ -240,7 +237,7 @@ async def begin_create_or_update( backend_address_pool_name: str, parameters: "models.BackendAddressPool", **kwargs - ) -> "models.BackendAddressPool": + ) -> AsyncLROPoller["models.BackendAddressPool"]: """Creates or updates a load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -258,8 +255,8 @@ async def begin_create_or_update( 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: BackendAddressPool, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BackendAddressPool + :return: An instance of AsyncLROPoller that returns either BackendAddressPool or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.BackendAddressPool] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -332,7 +329,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -352,7 +348,7 @@ async def begin_delete( load_balancer_name: str, backend_address_pool_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -367,8 +363,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py index 28e3dbecd878..dab12fcd2bdf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py index 8446c580c6b3..94737ba5e3e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py index 21d5e95b25ee..9f7095e400ff 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py index 102d051a721b..4411168b71e1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_probes_operations_async.py index be6db6ae768b..afee2839e4c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_probes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancers_operations_async.py index 8533e0ab0306..723abe3c13df 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_load_balancers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, load_balancer_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('LoadBalancer', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( load_balancer_name: str, parameters: "models.LoadBalancer", **kwargs - ) -> "models.LoadBalancer": + ) -> AsyncLROPoller["models.LoadBalancer"]: """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.LoadBalancer + :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.LoadBalancer] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_local_network_gateways_operations_async.py index 33770e848204..9444f9f73159 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_local_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( local_network_gateway_name: str, parameters: "models.LocalNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.LocalNetworkGateway + :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.LocalNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, local_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -405,6 +400,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_nat_gateways_operations_async.py index 1a44a8ff6520..7a6f06fca419 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_nat_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_nat_gateways_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, nat_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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) @@ -269,7 +265,7 @@ async def begin_create_or_update( nat_gateway_name: str, parameters: "models.NatGateway", **kwargs - ) -> "models.NatGateway": + ) -> AsyncLROPoller["models.NatGateway"]: """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: NatGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.NatGateway + :return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.NatGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -372,7 +368,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -476,6 +471,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -488,15 +487,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py index 8d980de435b2..308bad36b667 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -155,7 +155,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py index f72755d6fecd..7ed15f8ca05a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py @@ -64,6 +64,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py index 99546d750f00..19abac3279d3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_interface_name: str, tap_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( tap_configuration_name: str, tap_configuration_parameters: "models.NetworkInterfaceTapConfiguration", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: NetworkInterfaceTapConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceTapConfiguration + :return: An instance of AsyncLROPoller that returns either NetworkInterfaceTapConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceTapConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interfaces_operations_async.py index 170d5b983c50..a25e74c3a188 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interfaces_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interfaces_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_interface_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkInterface', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_interface_name: str, parameters: "models.NetworkInterface", **kwargs - ) -> "models.NetworkInterface": + ) -> AsyncLROPoller["models.NetworkInterface"]: """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkInterface + :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.NetworkInterface] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -525,8 +520,8 @@ async def _get_effective_route_table_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + ) -> Optional["models.EffectiveRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -548,7 +543,6 @@ async def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -572,7 +566,7 @@ async def begin_get_effective_route_table( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveRouteListResult": + ) -> AsyncLROPoller["models.EffectiveRouteListResult"]: """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -585,8 +579,8 @@ async def begin_get_effective_route_table( 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: EffectiveRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.EffectiveRouteListResult + :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.EffectiveRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -633,8 +627,8 @@ async def _list_effective_network_security_groups_initial( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "models.EffectiveNetworkSecurityGroupListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + ) -> Optional["models.EffectiveNetworkSecurityGroupListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -656,7 +650,6 @@ async def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -680,7 +673,7 @@ async def begin_list_effective_network_security_groups( resource_group_name: str, network_interface_name: str, **kwargs - ) -> "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. @@ -693,8 +686,8 @@ async def begin_list_effective_network_security_groups( 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: EffectiveNetworkSecurityGroupListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.EffectiveNetworkSecurityGroupListResult + :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.EffectiveNetworkSecurityGroupListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -763,6 +756,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -777,15 +774,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -835,6 +828,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -848,15 +845,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -935,7 +928,6 @@ async def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -984,6 +976,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1001,15 +997,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1092,7 +1084,6 @@ async def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_management_client_operations_async.py index d3122b7ef191..840910161484 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_management_client_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_management_client_operations_async.py @@ -29,8 +29,8 @@ async def _put_bastion_shareable_link_initial( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + ) -> Optional["models.BastionShareableLinkListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -54,7 +54,6 @@ async def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -83,7 +82,7 @@ async def begin_put_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> "models.BastionShareableLinkListResult": + ) -> AsyncLROPoller["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. @@ -98,8 +97,8 @@ async def begin_put_bastion_shareable_link( 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: BastionShareableLinkListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult + :return: An instance of AsyncLROPoller that returns either BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.BastionShareableLinkListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -172,7 +171,6 @@ async def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -196,7 +194,7 @@ async def begin_delete_bastion_shareable_link( bastion_host_name: str, bsl_request: "models.BastionShareableLinkListRequest", **kwargs - ) -> None: + ) -> 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. @@ -211,8 +209,8 @@ async def begin_delete_bastion_shareable_link( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -279,6 +277,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -292,19 +295,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -337,8 +339,8 @@ async def _get_active_sessions_initial( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + ) -> Optional["models.BastionActiveSessionListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -360,7 +362,6 @@ async def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -384,7 +385,7 @@ async def begin_get_active_sessions( resource_group_name: str, bastion_host_name: str, **kwargs - ) -> "models.BastionActiveSessionListResult": + ) -> AsyncLROPoller["models.BastionActiveSessionListResult"]: """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -397,8 +398,8 @@ async def begin_get_active_sessions( 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: BastionActiveSessionListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BastionActiveSessionListResult + :return: An instance of AsyncLROPoller that returns either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.BastionActiveSessionListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -467,6 +468,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -480,19 +486,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -560,7 +565,6 @@ async def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -617,7 +621,6 @@ async def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -640,8 +643,8 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -665,7 +668,6 @@ async def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -694,7 +696,7 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( virtual_wan_name: str, vpn_client_params: "models.VirtualWanVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": + ) -> AsyncLROPoller["models.VpnProfileResponse"]: """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. @@ -712,8 +714,8 @@ async def begin_generatevirtualwanvpnserverconfigurationvpnprofile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_profiles_operations_async.py index 9bc2d0e94477..e21a00864299 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_profiles_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_profiles_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_profile_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -260,7 +257,6 @@ async def create_or_update( 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('NetworkProfile', pipeline_response) @@ -317,7 +313,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -355,6 +350,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -366,15 +365,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -421,6 +416,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_security_groups_operations_async.py index b6ffe81b8713..4ed26e61c0bd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_security_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_security_groups_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_security_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( network_security_group_name: str, parameters: "models.NetworkSecurityGroup", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroup + :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.NetworkSecurityGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_virtual_appliances_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_virtual_appliances_operations_async.py index b6bc4740d07f..dea5513b6e96 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_virtual_appliances_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_virtual_appliances_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, network_virtual_appliance_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -247,7 +245,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -299,7 +296,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkVirtualAppliance') body_content_kwargs['content'] = body_content @@ -312,7 +308,6 @@ 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('NetworkVirtualAppliance', pipeline_response) @@ -331,7 +326,7 @@ async def begin_create_or_update( network_virtual_appliance_name: str, parameters: "models.NetworkVirtualAppliance", **kwargs - ) -> "models.NetworkVirtualAppliance": + ) -> AsyncLROPoller["models.NetworkVirtualAppliance"]: """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -346,8 +341,8 @@ async def begin_create_or_update( 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: NetworkVirtualAppliance, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkVirtualAppliance + :return: An instance of AsyncLROPoller that returns either NetworkVirtualAppliance or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.NetworkVirtualAppliance] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -410,6 +405,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -422,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_watchers_operations_async.py index 729f692119f7..e3b0b38bfb38 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_watchers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_watchers_operations_async.py @@ -87,7 +87,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -101,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -153,7 +151,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -198,7 +195,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -218,7 +214,7 @@ async def begin_delete( resource_group_name: str, network_watcher_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -231,8 +227,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -315,7 +311,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -357,6 +352,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -369,15 +368,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -422,6 +417,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -513,7 +508,6 @@ async def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -566,7 +560,6 @@ async def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -580,7 +573,6 @@ async def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -599,7 +591,7 @@ async def begin_verify_ip_flow( network_watcher_name: str, parameters: "models.VerificationIPFlowParameters", **kwargs - ) -> "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. @@ -614,8 +606,8 @@ async def begin_verify_ip_flow( 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: VerificationIPFlowResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VerificationIPFlowResult + :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VerificationIPFlowResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +681,6 @@ async def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -703,7 +694,6 @@ async def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -722,7 +712,7 @@ async def begin_get_next_hop( network_watcher_name: str, parameters: "models.NextHopParameters", **kwargs - ) -> "models.NextHopResult": + ) -> AsyncLROPoller["models.NextHopResult"]: """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -737,8 +727,8 @@ async def begin_get_next_hop( 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: NextHopResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.NextHopResult + :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.NextHopResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -812,7 +802,6 @@ async def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -826,7 +815,6 @@ async def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -845,7 +833,7 @@ async def begin_get_vm_security_rules( network_watcher_name: str, parameters: "models.SecurityGroupViewParameters", **kwargs - ) -> "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. @@ -860,8 +848,8 @@ async def begin_get_vm_security_rules( 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: SecurityGroupViewResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityGroupViewResult + :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.SecurityGroupViewResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +923,6 @@ async def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -949,7 +936,6 @@ async def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -968,7 +954,7 @@ async def begin_get_troubleshooting( network_watcher_name: str, parameters: "models.TroubleshootingParameters", **kwargs - ) -> "models.TroubleshootingResult": + ) -> AsyncLROPoller["models.TroubleshootingResult"]: """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -983,8 +969,8 @@ async def begin_get_troubleshooting( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1058,7 +1044,6 @@ async def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1072,7 +1057,6 @@ async def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1091,7 +1075,7 @@ async def begin_get_troubleshooting_result( network_watcher_name: str, parameters: "models.QueryTroubleshootingParameters", **kwargs - ) -> "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. @@ -1106,8 +1090,8 @@ async def begin_get_troubleshooting_result( 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: TroubleshootingResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.TroubleshootingResult + :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.TroubleshootingResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1181,7 +1165,6 @@ async def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1195,7 +1178,6 @@ async def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1214,7 +1196,7 @@ async def begin_set_flow_log_configuration( network_watcher_name: str, parameters: "models.FlowLogInformation", **kwargs - ) -> "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. @@ -1229,8 +1211,8 @@ async def begin_set_flow_log_configuration( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1304,7 +1286,6 @@ async def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1318,7 +1299,6 @@ async def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1337,7 +1317,7 @@ async def begin_get_flow_log_status( network_watcher_name: str, parameters: "models.FlowLogStatusParameters", **kwargs - ) -> "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. @@ -1353,8 +1333,8 @@ async def begin_get_flow_log_status( 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: FlowLogInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.FlowLogInformation + :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.FlowLogInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1428,7 +1408,6 @@ async def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1442,7 +1421,6 @@ async def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1461,7 +1439,7 @@ async def begin_check_connectivity( network_watcher_name: str, parameters: "models.ConnectivityParameters", **kwargs - ) -> "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,8 +1455,8 @@ async def begin_check_connectivity( 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: ConnectivityInformation, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectivityInformation + :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ConnectivityInformation] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1552,7 +1530,6 @@ async def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1566,7 +1543,6 @@ async def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1585,7 +1561,7 @@ async def begin_get_azure_reachability_report( network_watcher_name: str, parameters: "models.AzureReachabilityReportParameters", **kwargs - ) -> "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. @@ -1602,8 +1578,8 @@ async def begin_get_azure_reachability_report( 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: AzureReachabilityReport, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.AzureReachabilityReport + :return: An instance of AsyncLROPoller that returns either AzureReachabilityReport or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.AzureReachabilityReport] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1677,7 +1653,6 @@ async def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1691,7 +1666,6 @@ async def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1710,7 +1684,7 @@ async def begin_list_available_providers( network_watcher_name: str, parameters: "models.AvailableProvidersListParameters", **kwargs - ) -> "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. @@ -1726,8 +1700,8 @@ async def begin_list_available_providers( 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: AvailableProvidersList, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.AvailableProvidersList + :return: An instance of AsyncLROPoller that returns either AvailableProvidersList or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.AvailableProvidersList] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1801,7 +1775,6 @@ async def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1815,7 +1788,6 @@ async def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1834,7 +1806,7 @@ async def begin_get_network_configuration_diagnostic( network_watcher_name: str, parameters: "models.NetworkConfigurationDiagnosticParameters", **kwargs - ) -> "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 @@ -1853,8 +1825,8 @@ async def begin_get_network_configuration_diagnostic( 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: NetworkConfigurationDiagnosticResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.NetworkConfigurationDiagnosticResponse + :return: An instance of AsyncLROPoller that returns either NetworkConfigurationDiagnosticResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.NetworkConfigurationDiagnosticResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_operations_async.py index 2dc03475561f..b3aba8b70ca1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_operations_async.py @@ -58,6 +58,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,15 +69,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_p2_svpn_gateways_operations_async.py index 086a8bf18933..95e89dd0e34d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_p2_svpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, p2_s_vpn_gateway_parameters: "models.P2SVpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -267,7 +264,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -315,7 +311,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -334,7 +329,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -347,8 +342,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -407,6 +402,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -471,6 +466,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -482,15 +481,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -523,8 +518,8 @@ async def _generate_vpn_profile_initial( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "models.VpnProfileResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + ) -> Optional["models.VpnProfileResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -548,7 +543,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -577,7 +571,7 @@ async def begin_generate_vpn_profile( gateway_name: str, parameters: "models.P2SVpnProfileParameters", **kwargs - ) -> "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. @@ -593,8 +587,8 @@ async def begin_generate_vpn_profile( 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: VpnProfileResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse + :return: An instance of AsyncLROPoller that returns either VpnProfileResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnProfileResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -642,8 +636,8 @@ async def _get_p2_s_vpn_connection_health_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + ) -> Optional["models.P2SVpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -665,7 +659,6 @@ async def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -689,7 +682,7 @@ async def begin_get_p2_s_vpn_connection_health( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.P2SVpnGateway": + ) -> AsyncLROPoller["models.P2SVpnGateway"]: """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -703,8 +696,8 @@ async def begin_get_p2_s_vpn_connection_health( 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: P2SVpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.P2SVpnGateway + :return: An instance of AsyncLROPoller that returns either P2SVpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.P2SVpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -752,8 +745,8 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "models.P2SVpnConnectionHealth": - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + ) -> Optional["models.P2SVpnConnectionHealth"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -777,7 +770,6 @@ async def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -806,7 +798,7 @@ async def begin_get_p2_s_vpn_connection_health_detailed( gateway_name: str, request: "models.P2SVpnConnectionHealthRequest", **kwargs - ) -> "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. @@ -822,8 +814,8 @@ async def begin_get_p2_s_vpn_connection_health_detailed( 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: P2SVpnConnectionHealth, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.P2SVpnConnectionHealth + :return: An instance of AsyncLROPoller that returns either P2SVpnConnectionHealth or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.P2SVpnConnectionHealth] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -896,7 +888,6 @@ async def _disconnect_p2_s_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -920,7 +911,7 @@ async def begin_disconnect_p2_s_vpn_connections( p2_s_vpn_gateway_name: str, request: "models.P2SVpnConnectionRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. @@ -936,8 +927,8 @@ async def begin_disconnect_p2_s_vpn_connections( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_packet_captures_operations_async.py index c772cd1a7e01..93b7184cc354 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_packet_captures_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_packet_captures_operations_async.py @@ -76,7 +76,6 @@ async def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -105,7 +104,7 @@ async def begin_create( packet_capture_name: str, parameters: "models.PacketCapture", **kwargs - ) -> "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. @@ -122,8 +121,8 @@ async def begin_create( 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: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PacketCaptureResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.PacketCaptureResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -210,7 +209,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -257,7 +255,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -278,7 +275,7 @@ async def begin_delete( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -293,8 +290,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -363,7 +360,6 @@ async def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -384,7 +380,7 @@ async def begin_stop( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -399,8 +395,8 @@ async def begin_stop( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -470,7 +466,6 @@ async def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -480,7 +475,6 @@ async def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -499,7 +493,7 @@ async def begin_get_status( network_watcher_name: str, packet_capture_name: str, **kwargs - ) -> "models.PacketCaptureQueryStatusResult": + ) -> AsyncLROPoller["models.PacketCaptureQueryStatusResult"]: """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -514,8 +508,8 @@ async def begin_get_status( 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: PacketCaptureQueryStatusResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PacketCaptureQueryStatusResult + :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.PacketCaptureQueryStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,6 +575,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -594,15 +592,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py index 2abf587184ef..bc24ea982630 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -89,7 +89,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -133,6 +132,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -147,15 +150,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_dns_zone_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_dns_zone_groups_operations_async.py index 6cb382672435..b08afb0f0966 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_dns_zone_groups_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_dns_zone_groups_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( private_endpoint_name: str, private_dns_zone_group_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private dns zone group. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateDnsZoneGroup') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('PrivateDnsZoneGroup', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( private_dns_zone_group_name: str, parameters: "models.PrivateDnsZoneGroup", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: PrivateDnsZoneGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateDnsZoneGroup + :return: An instance of AsyncLROPoller that returns either PrivateDnsZoneGroup or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.PrivateDnsZoneGroup] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_endpoints_operations_async.py index 5598940a65b1..4c4fa00275f9 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_endpoints_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_endpoints_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, private_endpoint_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( private_endpoint_name: str, parameters: "models.PrivateEndpoint", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateEndpoint + :return: An instance of AsyncLROPoller that returns either PrivateEndpoint or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.PrivateEndpoint] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_link_services_operations_async.py index db14a64ca84b..f28d8160b7ad 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_link_services_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_private_link_services_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, service_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( service_name: str, parameters: "models.PrivateLinkService", **kwargs - ) -> "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. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: PrivateLinkService, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateLinkService + :return: An instance of AsyncLROPoller that returns either PrivateLinkService or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.PrivateLinkService] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list_by_subscription( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -509,7 +505,6 @@ async def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -575,7 +570,6 @@ async def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -626,7 +620,6 @@ async def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -647,7 +640,7 @@ async def begin_delete_private_endpoint_connection( service_name: str, pe_connection_name: str, **kwargs - ) -> None: + ) -> 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. @@ -662,8 +655,8 @@ async def begin_delete_private_endpoint_connection( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -726,6 +719,10 @@ def list_private_endpoint_connections( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -739,15 +736,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -775,31 +768,20 @@ async def get_next(next_link=None): ) 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( + async def _check_private_link_service_visibility_initial( self, location: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "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_04_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + ) -> Optional["models.PrivateLinkServiceVisibility"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -815,7 +797,6 @@ async def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -824,47 +805,96 @@ async def check_private_link_service_visibility( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - async def check_private_link_service_visibility_by_resource_group( + async def begin_check_private_link_service_visibility( self, location: str, - resource_group_name: str, parameters: "models.CheckPrivateLinkServiceVisibilityRequest", **kwargs - ) -> "models.PrivateLinkServiceVisibility": - """Checks whether the subscription is visible to private link service in the specified resource - group. + ) -> 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 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_04_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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_04_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -881,7 +911,6 @@ async def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -890,17 +919,85 @@ async def check_private_link_service_visibility_by_resource_group( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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_04_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_04_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -923,6 +1020,10 @@ def list_auto_approved_private_link_services( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -935,15 +1036,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -994,6 +1091,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1007,15 +1108,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_public_ip_addresses_operations_async.py index df8ea83e875a..b1f70fd14579 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_public_ip_addresses_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_address_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPAddress', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_address_name: str, parameters: "models.PublicIPAddress", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPAddress + :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.PublicIPAddress] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -543,6 +538,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -556,15 +555,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -624,6 +619,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -640,15 +639,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -735,7 +730,6 @@ async def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_public_ip_prefixes_operations_async.py index 8f81c77351f7..219cab4867cf 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_public_ip_prefixes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_public_ip_prefixes_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, public_ip_prefix_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( public_ip_prefix_name: str, parameters: "models.PublicIPPrefix", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: PublicIPPrefix, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PublicIPPrefix + :return: An instance of AsyncLROPoller that returns either PublicIPPrefix or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.PublicIPPrefix] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_resource_navigation_links_operations_async.py index 614983729cfd..b0559859ef27 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_resource_navigation_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_filter_rules_operations_async.py index 6267ef1f5ab5..eb86f9cab758 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_filter_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_filter_name: str, rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('RouteFilterRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( rule_name: str, route_filter_rule_parameters: "models.RouteFilterRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteFilterRule + :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.RouteFilterRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list_by_route_filter( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_filters_operations_async.py index a370f5818581..c1e1c9f6fe23 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_filters_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_filters_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_filter_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteFilter', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_filter_name: str, route_filter_parameters: "models.RouteFilter", **kwargs - ) -> "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. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteFilter + :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.RouteFilter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -411,6 +406,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -423,15 +422,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -475,6 +470,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_tables_operations_async.py index b17cabfac118..73d0a49f6582 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_tables_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_route_tables_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('RouteTable', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( route_table_name: str, parameters: "models.RouteTable", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.RouteTable + :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.RouteTable] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -410,6 +405,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -422,15 +421,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_routes_operations_async.py index 4f9e380c178a..00d7e2ca3845 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_routes_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_routes_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( route_table_name: str, route_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('Route', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( route_name: str, route_parameters: "models.Route", **kwargs - ) -> "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. @@ -291,8 +287,8 @@ async def begin_create_or_update( 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: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.Route + :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.Route] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -359,6 +355,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -372,15 +372,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_security_partner_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_security_partner_providers_operations_async.py index 1b8afa1beaa2..ce20fccecc7d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_security_partner_providers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_security_partner_providers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, security_partner_provider_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityPartnerProvider') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('SecurityPartnerProvider', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( security_partner_provider_name: str, parameters: "models.SecurityPartnerProvider", **kwargs - ) -> "models.SecurityPartnerProvider": + ) -> AsyncLROPoller["models.SecurityPartnerProvider"]: """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -277,8 +273,8 @@ async def begin_create_or_update( 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: SecurityPartnerProvider, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProvider + :return: An instance of AsyncLROPoller that returns either SecurityPartnerProvider or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.SecurityPartnerProvider] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -365,7 +361,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -406,6 +401,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -470,6 +465,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -481,15 +480,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_security_rules_operations_async.py index 27bcf6091e93..c3672641478a 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_security_rules_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_security_rules_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( network_security_group_name: str, security_rule_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('SecurityRule', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( security_rule_name: str, security_rule_parameters: "models.SecurityRule", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.SecurityRule + :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.SecurityRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_association_links_operations_async.py index 504c54ca8f9e..240e5066f80f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_association_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_association_links_operations_async.py @@ -83,7 +83,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_endpoint_policies_operations_async.py index 4e61d4e547ac..278c4aa491ab 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_endpoint_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, service_endpoint_policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( service_endpoint_policy_name: str, parameters: "models.ServiceEndpointPolicy", **kwargs - ) -> "models.ServiceEndpointPolicy": + ) -> AsyncLROPoller["models.ServiceEndpointPolicy"]: """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -282,8 +278,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicy + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -370,7 +366,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -408,6 +403,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -419,15 +418,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -474,6 +469,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -486,15 +485,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py index fd7b6d81a019..25a2e9d01818 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( service_endpoint_policy_name: str, service_endpoint_policy_definition_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -193,7 +192,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -256,7 +253,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -276,7 +272,7 @@ async def begin_create_or_update( service_endpoint_policy_definition_name: str, service_endpoint_policy_definitions: "models.ServiceEndpointPolicyDefinition", **kwargs - ) -> "models.ServiceEndpointPolicyDefinition": + ) -> AsyncLROPoller["models.ServiceEndpointPolicyDefinition"]: """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: ServiceEndpointPolicyDefinition, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyDefinition + :return: An instance of AsyncLROPoller that returns either ServiceEndpointPolicyDefinition or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ServiceEndpointPolicyDefinition] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,6 +360,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_tags_operations_async.py index 6d9afc7e8fb2..b4e388035b0c 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_tags_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_service_tags_operations_async.py @@ -77,7 +77,6 @@ async def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_subnets_operations_async.py index 90eaa358ab97..5813630fe5d2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_subnets_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_subnets_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, subnet_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -196,7 +195,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -246,7 +244,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -259,7 +256,6 @@ 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('Subnet', pipeline_response) @@ -279,7 +275,7 @@ async def begin_create_or_update( subnet_name: str, subnet_parameters: "models.Subnet", **kwargs - ) -> "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. @@ -296,8 +292,8 @@ async def begin_create_or_update( 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: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.Subnet + :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.Subnet] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -373,7 +369,6 @@ async def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -398,7 +393,7 @@ async def begin_prepare_network_policies( subnet_name: str, prepare_network_policies_request_parameters: "models.PrepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -416,8 +411,8 @@ async def begin_prepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -490,7 +485,6 @@ async def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -515,7 +509,7 @@ async def begin_unprepare_network_policies( subnet_name: str, unprepare_network_policies_request_parameters: "models.UnprepareNetworkPoliciesRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -533,8 +527,8 @@ async def begin_unprepare_network_policies( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -598,6 +592,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -611,15 +609,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_usages_operations_async.py index 0f95bf19e6e7..71c08ba14aba 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_usages_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_usages_operations_async.py @@ -61,6 +61,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -73,15 +77,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py index cac6cca3025d..9a8cdc0530e2 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -137,7 +136,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -151,7 +149,6 @@ async def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -171,7 +168,7 @@ async def begin_create_or_update( route_table_name: str, virtual_hub_route_table_v2_parameters: "models.VirtualHubRouteTableV2", **kwargs - ) -> "models.VirtualHubRouteTableV2": + ) -> AsyncLROPoller["models.VirtualHubRouteTableV2"]: """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -190,8 +187,8 @@ async def begin_create_or_update( 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: VirtualHubRouteTableV2, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualHubRouteTableV2 + :return: An instance of AsyncLROPoller that returns either VirtualHubRouteTableV2 or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualHubRouteTableV2] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -264,7 +261,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -285,7 +281,7 @@ async def begin_delete( virtual_hub_name: str, route_table_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -300,8 +296,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -364,6 +360,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -377,15 +377,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_hubs_operations_async.py index a255ffaf229d..a0c4dfb9f315 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_hubs_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualHub', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_hub_name: str, virtual_hub_parameters: "models.VirtualHub", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualHub, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualHub + :return: An instance of AsyncLROPoller that returns either VirtualHub or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualHub] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_hub_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py index 52d8a8b9ea36..70d0a5a17ef1 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_connection_name: str, parameters: "models.VirtualNetworkGatewayConnection", **kwargs - ) -> "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. @@ -123,8 +121,8 @@ async def begin_create_or_update( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +205,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -251,7 +248,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -270,7 +266,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -330,8 +326,8 @@ async def _update_tags_initial( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + ) -> Optional["models.VirtualNetworkGatewayConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -355,7 +351,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -384,7 +379,7 @@ async def begin_update_tags( virtual_network_gateway_connection_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGatewayConnection": + ) -> AsyncLROPoller["models.VirtualNetworkGatewayConnection"]: """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -400,8 +395,8 @@ async def begin_update_tags( 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: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayConnection + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGatewayConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -475,7 +470,6 @@ async def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -488,7 +482,6 @@ async def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -507,7 +500,7 @@ async def begin_set_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionSharedKey", **kwargs - ) -> "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. @@ -525,8 +518,8 @@ async def begin_set_shared_key( 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: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ConnectionSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -610,7 +603,6 @@ async def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -648,6 +640,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -660,15 +656,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -701,8 +693,8 @@ async def _reset_shared_key_initial( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "models.ConnectionResetSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + ) -> Optional["models.ConnectionResetSharedKey"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -726,7 +718,6 @@ async def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -755,7 +746,7 @@ async def begin_reset_shared_key( virtual_network_gateway_connection_name: str, parameters: "models.ConnectionResetSharedKey", **kwargs - ) -> "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. @@ -774,8 +765,8 @@ async def begin_reset_shared_key( 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: ConnectionResetSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.ConnectionResetSharedKey + :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.ConnectionResetSharedKey] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -824,8 +815,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -849,7 +840,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -882,7 +872,7 @@ async def begin_start_packet_capture( virtual_network_gateway_connection_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> 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. @@ -899,8 +889,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -949,8 +939,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -974,7 +964,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1004,7 +993,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_connection_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> 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. @@ -1021,8 +1010,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py index ecd1e301c3c2..a69aa4446e3e 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -74,7 +74,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -87,7 +86,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -106,7 +104,7 @@ async def begin_create_or_update( virtual_network_gateway_name: str, parameters: "models.VirtualNetworkGateway", **kwargs - ) -> "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. @@ -121,8 +119,8 @@ async def begin_create_or_update( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -204,7 +202,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -248,7 +245,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -267,7 +263,7 @@ async def begin_delete( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -280,8 +276,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -326,8 +322,8 @@ async def _update_tags_initial( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -351,7 +347,6 @@ async def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -380,7 +375,7 @@ async def begin_update_tags( virtual_network_gateway_name: str, parameters: "models.TagsObject", **kwargs - ) -> "models.VirtualNetworkGateway": + ) -> AsyncLROPoller["models.VirtualNetworkGateway"]: """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -395,8 +390,8 @@ async def begin_update_tags( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -459,6 +454,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -471,15 +470,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -529,6 +524,10 @@ def list_connections( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -542,15 +541,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -583,8 +578,8 @@ async def _reset_initial( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + ) -> Optional["models.VirtualNetworkGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -608,7 +603,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -633,7 +627,7 @@ async def begin_reset( virtual_network_gateway_name: str, gateway_vip: Optional[str] = None, **kwargs - ) -> "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. @@ -649,8 +643,8 @@ async def begin_reset( 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: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGateway + :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -720,7 +714,6 @@ async def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -739,7 +732,7 @@ async def begin_reset_vpn_client_shared_key( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -753,8 +746,8 @@ async def begin_reset_vpn_client_shared_key( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -799,8 +792,8 @@ async def _generatevpnclientpackage_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -824,7 +817,6 @@ async def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -853,7 +845,7 @@ async def begin_generatevpnclientpackage( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -870,8 +862,8 @@ async def begin_generatevpnclientpackage( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -920,8 +912,8 @@ async def _generate_vpn_profile_initial( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -945,7 +937,6 @@ async def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -974,7 +965,7 @@ async def begin_generate_vpn_profile( virtual_network_gateway_name: str, parameters: "models.VpnClientParameters", **kwargs - ) -> str: + ) -> 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. @@ -991,8 +982,8 @@ async def begin_generate_vpn_profile( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1040,8 +1031,8 @@ async def _get_vpn_profile_package_url_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1063,7 +1054,6 @@ async def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1087,7 +1077,7 @@ async def begin_get_vpn_profile_package_url( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> str: + ) -> 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. @@ -1101,8 +1091,8 @@ async def begin_get_vpn_profile_package_url( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1150,8 +1140,8 @@ async def _get_bgp_peer_status_initial( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "models.BgpPeerStatusListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + ) -> Optional["models.BgpPeerStatusListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1175,7 +1165,6 @@ async def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1200,7 +1189,7 @@ async def begin_get_bgp_peer_status( virtual_network_gateway_name: str, peer: Optional[str] = None, **kwargs - ) -> "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. @@ -1215,8 +1204,8 @@ async def begin_get_bgp_peer_status( 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: BgpPeerStatusListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.BgpPeerStatusListResult + :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.BgpPeerStatusListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1298,7 +1287,6 @@ async def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1320,8 +1308,8 @@ async def _get_learned_routes_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1343,7 +1331,6 @@ async def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1367,7 +1354,7 @@ async def begin_get_learned_routes( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1381,8 +1368,8 @@ async def begin_get_learned_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1430,8 +1417,8 @@ async def _get_advertised_routes_initial( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + ) -> Optional["models.GatewayRouteListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1454,7 +1441,6 @@ async def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1479,7 +1465,7 @@ async def begin_get_advertised_routes( virtual_network_gateway_name: str, peer: str, **kwargs - ) -> "models.GatewayRouteListResult": + ) -> AsyncLROPoller["models.GatewayRouteListResult"]: """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1495,8 +1481,8 @@ async def begin_get_advertised_routes( 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: GatewayRouteListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.GatewayRouteListResult + :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.GatewayRouteListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1545,8 +1531,8 @@ async def _set_vpnclient_ipsec_parameters_initial( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "models.VpnClientIPsecParameters": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + ) -> Optional["models.VpnClientIPsecParameters"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1570,7 +1556,6 @@ async def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1599,7 +1584,7 @@ async def begin_set_vpnclient_ipsec_parameters( virtual_network_gateway_name: str, vpnclient_ipsec_params: "models.VpnClientIPsecParameters", **kwargs - ) -> "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. @@ -1616,8 +1601,8 @@ async def begin_set_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1688,7 +1673,6 @@ async def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -1710,7 +1694,7 @@ async def begin_get_vpnclient_ipsec_parameters( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -1725,8 +1709,8 @@ async def begin_get_vpnclient_ipsec_parameters( 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: VpnClientIPsecParameters, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnClientIPsecParameters + :return: An instance of AsyncLROPoller that returns either VpnClientIPsecParameters or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnClientIPsecParameters] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1797,6 @@ async def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1840,8 +1823,8 @@ async def _start_packet_capture_initial( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1865,7 +1848,6 @@ async def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1898,7 +1880,7 @@ async def begin_start_packet_capture( virtual_network_gateway_name: str, parameters: Optional["models.VpnPacketCaptureStartParameters"] = None, **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Starts packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -1914,8 +1896,8 @@ async def begin_start_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -1964,8 +1946,8 @@ async def _stop_packet_capture_initial( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: - cls = kwargs.pop('cls', None) # type: ClsType[str] + ) -> Optional[str]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1989,7 +1971,6 @@ async def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2019,7 +2000,7 @@ async def begin_stop_packet_capture( virtual_network_gateway_name: str, parameters: "models.VpnPacketCaptureStopParameters", **kwargs - ) -> str: + ) -> AsyncLROPoller[str]: """Stops packet capture on virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2035,8 +2016,8 @@ async def begin_stop_packet_capture( 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: str, or the result of cls(response) - :rtype: str + :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] @@ -2084,8 +2065,8 @@ async def _get_vpnclient_connection_health_initial( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "models.VpnClientConnectionHealthDetailListResult": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + ) -> Optional["models.VpnClientConnectionHealthDetailListResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -2107,7 +2088,6 @@ async def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -2131,7 +2111,7 @@ async def begin_get_vpnclient_connection_health( resource_group_name: str, virtual_network_gateway_name: str, **kwargs - ) -> "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. @@ -2145,8 +2125,8 @@ async def begin_get_vpnclient_connection_health( 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: VpnClientConnectionHealthDetailListResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnClientConnectionHealthDetailListResult + :return: An instance of AsyncLROPoller that returns either VpnClientConnectionHealthDetailListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnClientConnectionHealthDetailListResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2218,7 +2198,6 @@ async def _disconnect_virtual_network_gateway_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -2242,7 +2221,7 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( virtual_network_gateway_name: str, request: "models.P2SVpnConnectionRequest", **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Disconnect vpn connections of virtual network gateway in the specified resource group. :param resource_group_name: The name of the resource group. @@ -2257,8 +2236,8 @@ async def begin_disconnect_virtual_network_gateway_vpn_connections( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py index 00eae3da254d..f1f30f686e84 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -92,7 +91,7 @@ async def begin_delete( virtual_network_name: str, virtual_network_peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -107,8 +106,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -191,7 +190,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -241,7 +239,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -254,7 +251,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -274,7 +270,7 @@ async def begin_create_or_update( virtual_network_peering_name: str, virtual_network_peering_parameters: "models.VirtualNetworkPeering", **kwargs - ) -> "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. @@ -292,8 +288,8 @@ async def begin_create_or_update( 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: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkPeering + :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,6 +356,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_taps_operations_async.py index 0ea550829555..307209e778d7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_taps_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, tap_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -181,7 +180,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -229,7 +227,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -242,7 +239,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -261,7 +257,7 @@ async def begin_create_or_update( tap_name: str, parameters: "models.VirtualNetworkTap", **kwargs - ) -> "models.VirtualNetworkTap": + ) -> AsyncLROPoller["models.VirtualNetworkTap"]: """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -276,8 +272,8 @@ async def begin_create_or_update( 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: VirtualNetworkTap, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTap + :return: An instance of AsyncLROPoller that returns either VirtualNetworkTap or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualNetworkTap] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -364,7 +360,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -402,6 +397,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -413,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -468,6 +463,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_networks_operations_async.py index 88e2d690126c..fcba75964b29 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_networks_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_networks_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -89,7 +88,7 @@ async def begin_delete( resource_group_name: str, virtual_network_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -102,8 +101,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -186,7 +185,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -234,7 +232,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -247,7 +244,6 @@ 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('VirtualNetwork', pipeline_response) @@ -266,7 +262,7 @@ async def begin_create_or_update( virtual_network_name: str, parameters: "models.VirtualNetwork", **kwargs - ) -> "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. @@ -281,8 +277,8 @@ async def begin_create_or_update( 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: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualNetwork + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -369,7 +365,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -407,6 +402,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -418,15 +417,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -485,15 +484,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -563,7 +558,6 @@ async def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -603,6 +597,10 @@ def list_usage( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -616,15 +614,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_router_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_router_peerings_operations_async.py index cf91f9ea6515..78070a908e0f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_router_peerings_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_router_peerings_operations_async.py @@ -72,7 +72,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -93,7 +92,7 @@ async def begin_delete( virtual_router_name: str, peering_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -108,8 +107,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -192,7 +191,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -243,7 +241,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -257,7 +254,6 @@ async def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -277,7 +273,7 @@ async def begin_create_or_update( peering_name: str, parameters: "models.VirtualRouterPeering", **kwargs - ) -> "models.VirtualRouterPeering": + ) -> AsyncLROPoller["models.VirtualRouterPeering"]: """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -295,8 +291,8 @@ async def begin_create_or_update( 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: VirtualRouterPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualRouterPeering + :return: An instance of AsyncLROPoller that returns either VirtualRouterPeering or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualRouterPeering] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -363,6 +359,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -376,15 +376,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_routers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_routers_operations_async.py index 5ce5cfea8113..5045f5c344db 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_routers_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_routers_operations_async.py @@ -70,7 +70,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -90,7 +89,7 @@ async def begin_delete( resource_group_name: str, virtual_router_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -103,8 +102,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -187,7 +186,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -236,7 +234,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ async def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -269,7 +265,7 @@ async def begin_create_or_update( virtual_router_name: str, parameters: "models.VirtualRouter", **kwargs - ) -> "models.VirtualRouter": + ) -> AsyncLROPoller["models.VirtualRouter"]: """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -284,8 +280,8 @@ async def begin_create_or_update( 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: VirtualRouter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualRouter + :return: An instance of AsyncLROPoller that returns either VirtualRouter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualRouter] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -348,6 +344,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -360,15 +360,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -413,6 +409,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_wans_operations_async.py index 6a5ded3004b2..95a495c0eb70 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_wans_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_virtual_wans_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VirtualWAN', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( virtual_wan_name: str, wan_parameters: "models.VirtualWAN", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VirtualWAN, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VirtualWAN + :return: An instance of AsyncLROPoller that returns either VirtualWAN or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VirtualWAN] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_connections_operations_async.py index 1daae1951d64..078d313cc23f 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_connections_operations_async.py @@ -86,7 +86,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -136,7 +135,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnConnection', pipeline_response) @@ -169,7 +166,7 @@ async def begin_create_or_update( connection_name: str, vpn_connection_parameters: "models.VpnConnection", **kwargs - ) -> "models.VpnConnection": + ) -> AsyncLROPoller["models.VpnConnection"]: """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -187,8 +184,8 @@ async def begin_create_or_update( 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: VpnConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnConnection + :return: An instance of AsyncLROPoller that returns either VpnConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -261,7 +258,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -281,7 +277,7 @@ async def begin_delete( gateway_name: str, connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -296,8 +292,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -360,6 +356,10 @@ def list_by_vpn_gateway( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -373,15 +373,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_gateways_operations_async.py index 5f8d77a33c74..90bba42b5188 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_gateways_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_gateways_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnGateway', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( gateway_name: str, vpn_gateway_parameters: "models.VpnGateway", **kwargs - ) -> "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. @@ -178,8 +175,8 @@ async def begin_create_or_update( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -266,7 +263,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -314,7 +310,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -333,7 +328,7 @@ async def begin_delete( resource_group_name: str, gateway_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -346,8 +341,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -391,8 +386,8 @@ async def _reset_initial( resource_group_name: str, gateway_name: str, **kwargs - ) -> "models.VpnGateway": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + ) -> Optional["models.VpnGateway"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -414,7 +409,6 @@ async def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -438,7 +432,7 @@ async def begin_reset( resource_group_name: str, gateway_name: str, **kwargs - ) -> "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. @@ -451,8 +445,8 @@ async def begin_reset( 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: VpnGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnGateway + :return: An instance of AsyncLROPoller that returns either VpnGateway or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnGateway] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -514,6 +508,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -526,15 +524,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -578,6 +572,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -589,15 +587,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_link_connections_operations_async.py index c8670ebf78aa..6147630771e8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -68,6 +68,10 @@ def list_by_vpn_connection( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py index 87768e4fa330..448447bbc360 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py @@ -47,8 +47,8 @@ async def _list_initial( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "models.VpnServerConfigurationsResponse": - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + ) -> Optional["models.VpnServerConfigurationsResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -70,7 +70,6 @@ async def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -94,7 +93,7 @@ async def begin_list( resource_group_name: str, virtual_wan_name: str, **kwargs - ) -> "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. @@ -108,8 +107,8 @@ async def begin_list( 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: VpnServerConfigurationsResponse, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnServerConfigurationsResponse + :return: An instance of AsyncLROPoller that returns either VpnServerConfigurationsResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnServerConfigurationsResponse] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_server_configurations_operations_async.py index 89f7eedd4ac2..b0c0d3dd9d96 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_server_configurations_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_server_configurations_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_server_configuration_name: str, vpn_server_configuration_parameters: "models.VpnServerConfiguration", **kwargs - ) -> "models.VpnServerConfiguration": + ) -> AsyncLROPoller["models.VpnServerConfiguration"]: """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -180,8 +177,8 @@ async def begin_create_or_update( 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: VpnServerConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnServerConfiguration + :return: An instance of AsyncLROPoller that returns either VpnServerConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnServerConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -269,7 +266,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -317,7 +313,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -336,7 +331,7 @@ async def begin_delete( resource_group_name: str, vpn_server_configuration_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -349,8 +344,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -409,6 +404,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -421,15 +420,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -473,6 +468,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -484,15 +483,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_site_link_connections_operations_async.py index 675ed4a77e76..de4a52de8771 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_site_link_connections_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_site_link_connections_operations_async.py @@ -87,7 +87,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_site_links_operations_async.py index 2fbba6f203a2..7b8f2b362fd7 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_site_links_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -84,7 +84,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -124,6 +123,10 @@ def list_by_vpn_site( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -137,15 +140,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py index 21e9f216e566..188b36937caa 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -72,7 +72,6 @@ async def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -96,7 +95,7 @@ async def begin_download( virtual_wan_name: str, request: "models.GetVpnSitesConfigurationRequest", **kwargs - ) -> None: + ) -> 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. @@ -112,8 +111,8 @@ async def begin_download( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_sites_operations_async.py index ddffb8708acd..bcaaf101ba52 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_sites_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_vpn_sites_operations_async.py @@ -82,7 +82,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -130,7 +129,6 @@ async def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -143,7 +141,6 @@ 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('VpnSite', pipeline_response) @@ -162,7 +159,7 @@ async def begin_create_or_update( vpn_site_name: str, vpn_site_parameters: "models.VpnSite", **kwargs - ) -> "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. @@ -177,8 +174,8 @@ async def begin_create_or_update( 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: VpnSite, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.VpnSite + :return: An instance of AsyncLROPoller that returns either VpnSite or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.VpnSite] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -265,7 +262,6 @@ async def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -313,7 +309,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -332,7 +327,7 @@ async def begin_delete( resource_group_name: str, vpn_site_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -345,8 +340,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] @@ -405,6 +400,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -417,15 +416,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -469,6 +464,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -480,15 +479,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_web_application_firewall_policies_operations_async.py index aaa39f3a13d9..f42f8d2e43cd 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_web_application_firewall_policies_operations_async.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -63,6 +63,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -75,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -127,6 +127,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -138,15 +142,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -212,7 +212,6 @@ async def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -273,7 +272,6 @@ async def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -286,7 +284,6 @@ async def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -326,7 +323,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -345,7 +341,7 @@ async def begin_delete( resource_group_name: str, policy_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes Policy. :param resource_group_name: The name of the resource group. @@ -358,8 +354,8 @@ async def begin_delete( 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: None, or the result of cls(response) - :rtype: None + :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] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/__init__.py index 3f0c43c61f29..ff5f7f6ae7e5 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/__init__.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/__init__.py @@ -213,7 +213,6 @@ from ._models_py3 import ExpressRouteServiceProviderBandwidthsOffered from ._models_py3 import ExpressRouteServiceProviderListResult from ._models_py3 import FirewallPolicy - from ._models_py3 import FirewallPolicyCertificateAuthority from ._models_py3 import FirewallPolicyFilterRule from ._models_py3 import FirewallPolicyFilterRuleAction from ._models_py3 import FirewallPolicyListResult @@ -225,8 +224,6 @@ from ._models_py3 import FirewallPolicyRuleGroup from ._models_py3 import FirewallPolicyRuleGroupListResult from ._models_py3 import FirewallPolicyThreatIntelWhitelist - from ._models_py3 import FirewallPolicyTransportSecurity - from ._models_py3 import FirewallPolicyTrustedRootCertificate from ._models_py3 import FlowLog from ._models_py3 import FlowLogFormatParameters from ._models_py3 import FlowLogInformation @@ -710,7 +707,6 @@ from ._models import ExpressRouteServiceProviderBandwidthsOffered # type: ignore from ._models import ExpressRouteServiceProviderListResult # type: ignore from ._models import FirewallPolicy # type: ignore - from ._models import FirewallPolicyCertificateAuthority # type: ignore from ._models import FirewallPolicyFilterRule # type: ignore from ._models import FirewallPolicyFilterRuleAction # type: ignore from ._models import FirewallPolicyListResult # type: ignore @@ -722,8 +718,6 @@ from ._models import FirewallPolicyRuleGroup # type: ignore from ._models import FirewallPolicyRuleGroupListResult # type: ignore from ._models import FirewallPolicyThreatIntelWhitelist # type: ignore - from ._models import FirewallPolicyTransportSecurity # type: ignore - from ._models import FirewallPolicyTrustedRootCertificate # type: ignore from ._models import FlowLog # type: ignore from ._models import FlowLogFormatParameters # type: ignore from ._models import FlowLogInformation # type: ignore @@ -1055,7 +1049,6 @@ ExpressRoutePeeringType, ExpressRoutePortsEncapsulation, FirewallPolicyFilterRuleActionType, - FirewallPolicyIntrusionSystemMode, FirewallPolicyRuleConditionApplicationProtocolType, FirewallPolicyRuleConditionNetworkProtocol, FirewallPolicyRuleConditionType, @@ -1333,7 +1326,6 @@ 'ExpressRouteServiceProviderBandwidthsOffered', 'ExpressRouteServiceProviderListResult', 'FirewallPolicy', - 'FirewallPolicyCertificateAuthority', 'FirewallPolicyFilterRule', 'FirewallPolicyFilterRuleAction', 'FirewallPolicyListResult', @@ -1345,8 +1337,6 @@ 'FirewallPolicyRuleGroup', 'FirewallPolicyRuleGroupListResult', 'FirewallPolicyThreatIntelWhitelist', - 'FirewallPolicyTransportSecurity', - 'FirewallPolicyTrustedRootCertificate', 'FlowLog', 'FlowLogFormatParameters', 'FlowLogInformation', @@ -1676,7 +1666,6 @@ 'ExpressRoutePeeringType', 'ExpressRoutePortsEncapsulation', 'FirewallPolicyFilterRuleActionType', - 'FirewallPolicyIntrusionSystemMode', 'FirewallPolicyRuleConditionApplicationProtocolType', 'FirewallPolicyRuleConditionNetworkProtocol', 'FirewallPolicyRuleConditionType', diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_models.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_models.py index cec5459e5dfe..884694b49db8 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_models.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_models.py @@ -2306,8 +2306,6 @@ class ApplicationRuleCondition(FirewallPolicyRuleCondition): :param protocols: Array of Application Protocols. :type protocols: list[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyRuleConditionApplicationProtocol] - :param target_urls: List of Urls for this rule condition. - :type target_urls: list[str] :param target_fqdns: List of FQDNs for this rule condition. :type target_fqdns: list[str] :param fqdn_tags: List of FQDN Tags for this rule condition. @@ -2327,7 +2325,6 @@ class ApplicationRuleCondition(FirewallPolicyRuleCondition): 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, 'protocols': {'key': 'protocols', 'type': '[FirewallPolicyRuleConditionApplicationProtocol]'}, - 'target_urls': {'key': 'targetUrls', 'type': '[str]'}, 'target_fqdns': {'key': 'targetFqdns', 'type': '[str]'}, 'fqdn_tags': {'key': 'fqdnTags', 'type': '[str]'}, 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, @@ -2342,7 +2339,6 @@ def __init__( self.source_addresses = kwargs.get('source_addresses', None) self.destination_addresses = kwargs.get('destination_addresses', None) self.protocols = kwargs.get('protocols', None) - self.target_urls = kwargs.get('target_urls', 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) @@ -3773,13 +3769,13 @@ class BackendAddressPool(SubResource): :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_04_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_04_01.models.NetworkInterfaceIPConfiguration] - :param load_balancer_backend_addresses: An array of backend addresses. - :type load_balancer_backend_addresses: - list[~azure.mgmt.network.v2020_04_01.models.LoadBalancerBackendAddress] :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_04_01.models.SubResource] @@ -3808,8 +3804,8 @@ class BackendAddressPool(SubResource): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, '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]'}, @@ -3824,8 +3820,8 @@ def __init__( self.name = kwargs.get('name', None) self.etag = None self.type = None - self.backend_ip_configurations = 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 @@ -8393,8 +8389,6 @@ class FirewallPolicy(Resource): :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_04_01.models.ManagedServiceIdentity :ivar rule_groups: List of references to FirewallPolicyRuleGroups. :vartype rule_groups: list[~azure.mgmt.network.v2020_04_01.models.SubResource] :ivar provisioning_state: The provisioning state of the firewall policy resource. Possible @@ -8414,13 +8408,6 @@ class FirewallPolicy(Resource): :param threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. :type threat_intel_whitelist: ~azure.mgmt.network.v2020_04_01.models.FirewallPolicyThreatIntelWhitelist - :param intrusion_system_mode: The operation mode for Intrusion system. Possible values include: - "Enabled", "Disabled". - :type intrusion_system_mode: str or - ~azure.mgmt.network.v2020_04_01.models.FirewallPolicyIntrusionSystemMode - :param transport_security: TLS Configuration definition. - :type transport_security: - ~azure.mgmt.network.v2020_04_01.models.FirewallPolicyTransportSecurity """ _validation = { @@ -8440,7 +8427,6 @@ class FirewallPolicy(Resource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[SubResource]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'base_policy': {'key': 'properties.basePolicy', 'type': 'SubResource'}, @@ -8448,8 +8434,6 @@ class FirewallPolicy(Resource): 'child_policies': {'key': 'properties.childPolicies', 'type': '[SubResource]'}, 'threat_intel_mode': {'key': 'properties.threatIntelMode', 'type': 'str'}, 'threat_intel_whitelist': {'key': 'properties.threatIntelWhitelist', 'type': 'FirewallPolicyThreatIntelWhitelist'}, - 'intrusion_system_mode': {'key': 'properties.intrusionSystemMode', 'type': 'str'}, - 'transport_security': {'key': 'properties.transportSecurity', 'type': 'FirewallPolicyTransportSecurity'}, } def __init__( @@ -8458,7 +8442,6 @@ def __init__( ): super(FirewallPolicy, self).__init__(**kwargs) self.etag = None - self.identity = kwargs.get('identity', None) self.rule_groups = None self.provisioning_state = None self.base_policy = kwargs.get('base_policy', None) @@ -8466,32 +8449,6 @@ def __init__( 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.intrusion_system_mode = kwargs.get('intrusion_system_mode', None) - self.transport_security = kwargs.get('transport_security', None) - - -class FirewallPolicyCertificateAuthority(msrest.serialization.Model): - """Trusted Root certificates properties for tls. - - :param name: Name of the CA certificate. - :type name: 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 - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'key_vault_secret_id': {'key': 'properties.keyVaultSecretId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FirewallPolicyCertificateAuthority, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.key_vault_secret_id = kwargs.get('key_vault_secret_id', None) class FirewallPolicyRule(msrest.serialization.Model): @@ -8821,59 +8778,6 @@ def __init__( 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_04_01.models.FirewallPolicyCertificateAuthority - :param excluded_domains: List of domains which are excluded from TLS termination. - :type excluded_domains: list[str] - :param trusted_root_certificates: Certificates which are to be trusted by the firewall. - :type trusted_root_certificates: - list[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyTrustedRootCertificate] - """ - - _attribute_map = { - 'certificate_authority': {'key': 'certificateAuthority', 'type': 'FirewallPolicyCertificateAuthority'}, - 'excluded_domains': {'key': 'excludedDomains', 'type': '[str]'}, - 'trusted_root_certificates': {'key': 'trustedRootCertificates', 'type': '[FirewallPolicyTrustedRootCertificate]'}, - } - - def __init__( - self, - **kwargs - ): - super(FirewallPolicyTransportSecurity, self).__init__(**kwargs) - self.certificate_authority = kwargs.get('certificate_authority', None) - self.excluded_domains = kwargs.get('excluded_domains', None) - self.trusted_root_certificates = kwargs.get('trusted_root_certificates', None) - - -class FirewallPolicyTrustedRootCertificate(msrest.serialization.Model): - """Trusted Root certificates of a firewall policy. - - :param name: Name of the trusted root certificate that is unique within a firewall policy. - :type name: str - :param key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) the public - certificate data stored in KeyVault. - :type key_vault_secret_id: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'key_vault_secret_id': {'key': 'properties.keyVaultSecretId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FirewallPolicyTrustedRootCertificate, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.key_vault_secret_id = kwargs.get('key_vault_secret_id', None) - - class FlowLog(Resource): """A flow log resource. @@ -9434,9 +9338,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_04_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_04_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_04_01.models.ProvisioningState @@ -9457,8 +9361,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'}, } @@ -10632,23 +10536,28 @@ def __init__( 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_04_01.models.VirtualNetwork + :type virtual_network: ~azure.mgmt.network.v2020_04_01.models.SubResource :param ip_address: IP Address belonging to the referenced virtual network. :type ip_address: str - :param network_interface_ip_configuration: Reference to IP address defined in network + :ivar network_interface_ip_configuration: Reference to IP address defined in network interfaces. - :type network_interface_ip_configuration: - ~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfiguration + :vartype network_interface_ip_configuration: ~azure.mgmt.network.v2020_04_01.models.SubResource """ + _validation = { + 'network_interface_ip_configuration': {'readonly': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetwork'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, - 'network_interface_ip_configuration': {'key': 'properties.networkInterfaceIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'network_interface_ip_configuration': {'key': 'properties.networkInterfaceIPConfiguration', 'type': 'SubResource'}, } def __init__( @@ -10659,7 +10568,7 @@ def __init__( 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 = kwargs.get('network_interface_ip_configuration', None) + self.network_interface_ip_configuration = None class LoadBalancerBackendAddressPoolListResult(msrest.serialization.Model): @@ -11582,8 +11491,6 @@ class NatRuleCondition(FirewallPolicyRuleCondition): :type destination_ports: 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 """ _validation = { @@ -11599,7 +11506,6 @@ class NatRuleCondition(FirewallPolicyRuleCondition): 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, - 'terminate_tls': {'key': 'terminateTLS', 'type': 'bool'}, } def __init__( @@ -11613,7 +11519,6 @@ def __init__( 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.terminate_tls = kwargs.get('terminate_tls', None) class NetworkConfigurationDiagnosticParameters(msrest.serialization.Model): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_models_py3.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_models_py3.py index df5301d41ab0..186fa8b5c502 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_models_py3.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_models_py3.py @@ -2597,8 +2597,6 @@ class ApplicationRuleCondition(FirewallPolicyRuleCondition): :param protocols: Array of Application Protocols. :type protocols: list[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyRuleConditionApplicationProtocol] - :param target_urls: List of Urls for this rule condition. - :type target_urls: list[str] :param target_fqdns: List of FQDNs for this rule condition. :type target_fqdns: list[str] :param fqdn_tags: List of FQDN Tags for this rule condition. @@ -2618,7 +2616,6 @@ class ApplicationRuleCondition(FirewallPolicyRuleCondition): 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, 'protocols': {'key': 'protocols', 'type': '[FirewallPolicyRuleConditionApplicationProtocol]'}, - 'target_urls': {'key': 'targetUrls', 'type': '[str]'}, 'target_fqdns': {'key': 'targetFqdns', 'type': '[str]'}, 'fqdn_tags': {'key': 'fqdnTags', 'type': '[str]'}, 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, @@ -2632,7 +2629,6 @@ def __init__( source_addresses: Optional[List[str]] = None, destination_addresses: Optional[List[str]] = None, protocols: Optional[List["FirewallPolicyRuleConditionApplicationProtocol"]] = None, - target_urls: Optional[List[str]] = None, target_fqdns: Optional[List[str]] = None, fqdn_tags: Optional[List[str]] = None, source_ip_groups: Optional[List[str]] = None, @@ -2643,7 +2639,6 @@ def __init__( self.source_addresses = source_addresses self.destination_addresses = destination_addresses self.protocols = protocols - self.target_urls = target_urls self.target_fqdns = target_fqdns self.fqdn_tags = fqdn_tags self.source_ip_groups = source_ip_groups @@ -4244,13 +4239,13 @@ class BackendAddressPool(SubResource): :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_04_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_04_01.models.NetworkInterfaceIPConfiguration] - :param load_balancer_backend_addresses: An array of backend addresses. - :type load_balancer_backend_addresses: - list[~azure.mgmt.network.v2020_04_01.models.LoadBalancerBackendAddress] :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_04_01.models.SubResource] @@ -4279,8 +4274,8 @@ class BackendAddressPool(SubResource): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, '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]'}, @@ -4299,8 +4294,8 @@ def __init__( self.name = name self.etag = None self.type = None - self.backend_ip_configurations = 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 @@ -9365,8 +9360,6 @@ class FirewallPolicy(Resource): :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_04_01.models.ManagedServiceIdentity :ivar rule_groups: List of references to FirewallPolicyRuleGroups. :vartype rule_groups: list[~azure.mgmt.network.v2020_04_01.models.SubResource] :ivar provisioning_state: The provisioning state of the firewall policy resource. Possible @@ -9386,13 +9379,6 @@ class FirewallPolicy(Resource): :param threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. :type threat_intel_whitelist: ~azure.mgmt.network.v2020_04_01.models.FirewallPolicyThreatIntelWhitelist - :param intrusion_system_mode: The operation mode for Intrusion system. Possible values include: - "Enabled", "Disabled". - :type intrusion_system_mode: str or - ~azure.mgmt.network.v2020_04_01.models.FirewallPolicyIntrusionSystemMode - :param transport_security: TLS Configuration definition. - :type transport_security: - ~azure.mgmt.network.v2020_04_01.models.FirewallPolicyTransportSecurity """ _validation = { @@ -9412,7 +9398,6 @@ class FirewallPolicy(Resource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[SubResource]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'base_policy': {'key': 'properties.basePolicy', 'type': 'SubResource'}, @@ -9420,8 +9405,6 @@ class FirewallPolicy(Resource): 'child_policies': {'key': 'properties.childPolicies', 'type': '[SubResource]'}, 'threat_intel_mode': {'key': 'properties.threatIntelMode', 'type': 'str'}, 'threat_intel_whitelist': {'key': 'properties.threatIntelWhitelist', 'type': 'FirewallPolicyThreatIntelWhitelist'}, - 'intrusion_system_mode': {'key': 'properties.intrusionSystemMode', 'type': 'str'}, - 'transport_security': {'key': 'properties.transportSecurity', 'type': 'FirewallPolicyTransportSecurity'}, } def __init__( @@ -9430,17 +9413,13 @@ def __init__( 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, - intrusion_system_mode: Optional[Union[str, "FirewallPolicyIntrusionSystemMode"]] = None, - transport_security: Optional["FirewallPolicyTransportSecurity"] = None, **kwargs ): super(FirewallPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) self.etag = None - self.identity = identity self.rule_groups = None self.provisioning_state = None self.base_policy = base_policy @@ -9448,35 +9427,6 @@ def __init__( self.child_policies = None self.threat_intel_mode = threat_intel_mode self.threat_intel_whitelist = threat_intel_whitelist - self.intrusion_system_mode = intrusion_system_mode - self.transport_security = transport_security - - -class FirewallPolicyCertificateAuthority(msrest.serialization.Model): - """Trusted Root certificates properties for tls. - - :param name: Name of the CA certificate. - :type name: 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 - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'key_vault_secret_id': {'key': 'properties.keyVaultSecretId', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - key_vault_secret_id: Optional[str] = None, - **kwargs - ): - super(FirewallPolicyCertificateAuthority, self).__init__(**kwargs) - self.name = name - self.key_vault_secret_id = key_vault_secret_id class FirewallPolicyRule(msrest.serialization.Model): @@ -9840,66 +9790,6 @@ def __init__( 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_04_01.models.FirewallPolicyCertificateAuthority - :param excluded_domains: List of domains which are excluded from TLS termination. - :type excluded_domains: list[str] - :param trusted_root_certificates: Certificates which are to be trusted by the firewall. - :type trusted_root_certificates: - list[~azure.mgmt.network.v2020_04_01.models.FirewallPolicyTrustedRootCertificate] - """ - - _attribute_map = { - 'certificate_authority': {'key': 'certificateAuthority', 'type': 'FirewallPolicyCertificateAuthority'}, - 'excluded_domains': {'key': 'excludedDomains', 'type': '[str]'}, - 'trusted_root_certificates': {'key': 'trustedRootCertificates', 'type': '[FirewallPolicyTrustedRootCertificate]'}, - } - - def __init__( - self, - *, - certificate_authority: Optional["FirewallPolicyCertificateAuthority"] = None, - excluded_domains: Optional[List[str]] = None, - trusted_root_certificates: Optional[List["FirewallPolicyTrustedRootCertificate"]] = None, - **kwargs - ): - super(FirewallPolicyTransportSecurity, self).__init__(**kwargs) - self.certificate_authority = certificate_authority - self.excluded_domains = excluded_domains - self.trusted_root_certificates = trusted_root_certificates - - -class FirewallPolicyTrustedRootCertificate(msrest.serialization.Model): - """Trusted Root certificates of a firewall policy. - - :param name: Name of the trusted root certificate that is unique within a firewall policy. - :type name: str - :param key_vault_secret_id: Secret Id of (base-64 encoded unencrypted pfx) the public - certificate data stored in KeyVault. - :type key_vault_secret_id: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'key_vault_secret_id': {'key': 'properties.keyVaultSecretId', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - key_vault_secret_id: Optional[str] = None, - **kwargs - ): - super(FirewallPolicyTrustedRootCertificate, self).__init__(**kwargs) - self.name = name - self.key_vault_secret_id = key_vault_secret_id - - class FlowLog(Resource): """A flow log resource. @@ -10513,9 +10403,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_04_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_04_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_04_01.models.ProvisioningState @@ -10536,8 +10426,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'}, } @@ -11853,39 +11743,43 @@ def __init__( 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_04_01.models.VirtualNetwork + :type virtual_network: ~azure.mgmt.network.v2020_04_01.models.SubResource :param ip_address: IP Address belonging to the referenced virtual network. :type ip_address: str - :param network_interface_ip_configuration: Reference to IP address defined in network + :ivar network_interface_ip_configuration: Reference to IP address defined in network interfaces. - :type network_interface_ip_configuration: - ~azure.mgmt.network.v2020_04_01.models.NetworkInterfaceIPConfiguration + :vartype network_interface_ip_configuration: ~azure.mgmt.network.v2020_04_01.models.SubResource """ + _validation = { + 'network_interface_ip_configuration': {'readonly': True}, + } + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetwork'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'SubResource'}, 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, - 'network_interface_ip_configuration': {'key': 'properties.networkInterfaceIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'network_interface_ip_configuration': {'key': 'properties.networkInterfaceIPConfiguration', 'type': 'SubResource'}, } def __init__( self, *, name: Optional[str] = None, - virtual_network: Optional["VirtualNetwork"] = None, + virtual_network: Optional["SubResource"] = None, ip_address: Optional[str] = None, - network_interface_ip_configuration: Optional["NetworkInterfaceIPConfiguration"] = 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 = network_interface_ip_configuration + self.network_interface_ip_configuration = None class LoadBalancerBackendAddressPoolListResult(msrest.serialization.Model): @@ -12904,8 +12798,6 @@ class NatRuleCondition(FirewallPolicyRuleCondition): :type destination_ports: 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 """ _validation = { @@ -12921,7 +12813,6 @@ class NatRuleCondition(FirewallPolicyRuleCondition): 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, - 'terminate_tls': {'key': 'terminateTLS', 'type': 'bool'}, } def __init__( @@ -12934,7 +12825,6 @@ def __init__( destination_addresses: Optional[List[str]] = None, destination_ports: Optional[List[str]] = None, source_ip_groups: Optional[List[str]] = None, - terminate_tls: Optional[bool] = None, **kwargs ): super(NatRuleCondition, self).__init__(name=name, description=description, **kwargs) @@ -12944,7 +12834,6 @@ def __init__( self.destination_addresses = destination_addresses self.destination_ports = destination_ports self.source_ip_groups = source_ip_groups - self.terminate_tls = terminate_tls class NetworkConfigurationDiagnosticParameters(msrest.serialization.Model): diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_network_management_client_enums.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_network_management_client_enums.py index 26060d61538f..affc6a955c8d 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_network_management_client_enums.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/models/_network_management_client_enums.py @@ -456,13 +456,6 @@ class FirewallPolicyFilterRuleActionType(str, Enum): allow = "Allow" deny = "Deny" -class FirewallPolicyIntrusionSystemMode(str, Enum): - """The operation mode for Intrusion system mode. - """ - - enabled = "Enabled" - disabled = "Disabled" - class FirewallPolicyRuleConditionApplicationProtocolType(str, Enum): """The application protocol type of a Rule condition. """ 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 4e0e59ee8f0b..6c77e62822ef 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationGateway') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationGateway', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationGateway"] """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -555,7 +550,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -575,7 +569,7 @@ def begin_start( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -656,7 +650,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +669,7 @@ def begin_stop( application_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -736,8 +729,8 @@ def _backend_health_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealth"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -761,7 +754,6 @@ def _backend_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -787,7 +779,7 @@ def begin_backend_health( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -854,8 +846,8 @@ def _backend_health_on_demand_initial( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ApplicationGatewayBackendHealthOnDemand" - cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayBackendHealthOnDemand"] + # type: (...) -> Optional["models.ApplicationGatewayBackendHealthOnDemand"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ApplicationGatewayBackendHealthOnDemand"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -881,7 +873,6 @@ def _backend_health_on_demand_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(probe_request, 'ApplicationGatewayOnDemandProbe') body_content_kwargs['content'] = body_content @@ -912,7 +903,7 @@ def begin_backend_health_on_demand( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1007,7 +998,6 @@ def list_available_server_variables( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1057,7 +1047,6 @@ def list_available_request_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1107,7 +1096,6 @@ def list_available_response_headers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1157,7 +1145,6 @@ def list_available_waf_rule_sets( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1206,7 +1193,6 @@ def list_available_ssl_options( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1241,6 +1227,10 @@ def list_available_ssl_predefined_policies( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore @@ -1252,15 +1242,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1323,7 +1309,6 @@ def get_ssl_predefined_policy( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 04f0592947ee..f7e4357f7866 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( application_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ApplicationSecurityGroup', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ApplicationSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ApplicationSecurityGroup"] """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -375,7 +371,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -414,6 +409,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -425,15 +424,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -493,15 +492,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 dd24e90ebb7a..968241688e96 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 @@ -66,6 +66,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 97e659fc5f75..311db2d52e9d 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 @@ -66,6 +66,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ff374453481c..cdd1e53cee78 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 @@ -67,6 +67,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -79,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,6 +139,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -152,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 303b1b9bffc8..232993faa41b 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 14210c3b83ac..33574c46e121 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 @@ -66,6 +66,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -137,6 +137,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -150,15 +154,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8204e92e8534..6d3bda012fac 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 @@ -63,6 +63,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 84202ed8c6e3..22b6913374f9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( azure_firewall_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureFirewall') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('AzureFirewall', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.AzureFirewall" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Creates or updates the specified Azure Firewall. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.AzureFirewall" - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + # type: (...) -> Optional["models.AzureFirewall"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AzureFirewall"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.AzureFirewall"] """Updates tags of an Azure Firewall resource. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -536,6 +531,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -547,15 +546,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5649a444b498..d6a0ea7b68a2 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BastionHost') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('BastionHost', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.BastionHost" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionHost"] """Creates or updates the specified Bastion Host. :param resource_group_name: The name of the resource group. @@ -347,6 +343,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -358,15 +358,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -414,6 +410,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -426,15 +426,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e83ebfb82ef9..8a56036a4b8c 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 @@ -63,6 +63,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 803059b363d5..ca112a2eb73a 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionMonitor') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorResult', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.ConnectionMonitor" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ConnectionMonitorResult"] """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -397,7 +393,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -449,7 +444,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -471,7 +465,7 @@ def begin_stop( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -557,7 +551,6 @@ def _start_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -579,7 +572,7 @@ def begin_start( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing Network Watcher. @@ -666,7 +659,6 @@ def _query_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,7 +668,6 @@ def _query_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response) @@ -696,7 +687,7 @@ def begin_query( connection_monitor_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -779,6 +770,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -792,15 +787,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a9d3e9e4d539..f1dd4c494156 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 @@ -74,7 +74,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,7 +93,7 @@ def begin_delete( ddos_custom_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -187,7 +186,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,7 +234,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosCustomPolicy') body_content_kwargs['content'] = body_content @@ -249,7 +246,6 @@ 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('DdosCustomPolicy', pipeline_response) @@ -269,7 +265,7 @@ def begin_create_or_update( parameters, # type: "models.DdosCustomPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosCustomPolicy"] """Creates or updates a DDoS custom policy. :param resource_group_name: The name of the resource group. @@ -373,7 +369,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content 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 e356227f018d..183e8cb5cf15 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ddos_protection_plan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DdosProtectionPlan') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('DdosProtectionPlan', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.DdosProtectionPlan" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.DdosProtectionPlan"] """Creates or updates a DDoS protection plan. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 032734723b4e..2dffc1e35706 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a7bfd1e0b112..08714ab2be29 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( authorization_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified authorization from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitAuthorization', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( authorization_parameters, # type: "models.ExpressRouteCircuitAuthorization" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 378da4d13e06..3535a8b31655 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 @@ -79,7 +79,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,7 +100,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Express Route Circuit Connection from the specified express route circuit. @@ -209,7 +208,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -262,7 +260,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(express_route_circuit_connection_parameters, 'ExpressRouteCircuitConnection') body_content_kwargs['content'] = body_content @@ -275,7 +272,6 @@ 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('ExpressRouteCircuitConnection', pipeline_response) @@ -297,7 +293,7 @@ def begin_create_or_update( express_route_circuit_connection_parameters, # type: "models.ExpressRouteCircuitConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -391,6 +387,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -405,15 +405,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5bf21462184b..b5ee04037462 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('ExpressRouteCircuitPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCircuitPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b5f188f19a5f..3a058e8bc4c1 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( circuit_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRouteCircuit', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCircuit" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuit"] """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -403,8 +398,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -428,7 +423,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -455,7 +449,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -526,8 +520,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -551,7 +545,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -578,7 +571,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -649,8 +642,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -674,7 +667,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -701,7 +693,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableSummaryListResult"] """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -804,7 +796,6 @@ def get_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -865,7 +856,6 @@ def get_peering_stats( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -903,6 +893,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -915,15 +909,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -968,6 +958,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -979,15 +973,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 906c8d19ac30..e6cbf23c57c5 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 @@ -80,7 +80,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_connection_parameters, 'ExpressRouteConnection') body_content_kwargs['content'] = body_content @@ -93,7 +92,6 @@ 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('ExpressRouteConnection', pipeline_response) @@ -114,7 +112,7 @@ def begin_create_or_update( put_express_route_connection_parameters, # type: "models.ExpressRouteConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a connection to a ExpressRoute circuit. :param resource_group_name: The name of the resource group. @@ -385,7 +381,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 6eda31e99cbc..eb1057c0ebcd 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 @@ -71,6 +71,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from the ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -270,7 +269,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,7 +319,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(peering_parameters, 'ExpressRouteCrossConnectionPeering') body_content_kwargs['content'] = body_content @@ -334,7 +331,6 @@ 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('ExpressRouteCrossConnectionPeering', pipeline_response) @@ -355,7 +351,7 @@ def begin_create_or_update( peering_parameters, # type: "models.ExpressRouteCrossConnectionPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionPeering"] """Creates or updates a peering in the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. 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 9f1f94326267..0e0ea8a4a2b7 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 @@ -65,6 +65,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -132,6 +132,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -220,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -269,7 +268,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRouteCrossConnection') body_content_kwargs['content'] = body_content @@ -297,7 +295,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRouteCrossConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnection"] """Update the specified ExpressRouteCrossConnection. :param resource_group_name: The name of the resource group. @@ -402,7 +400,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(cross_connection_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -431,8 +428,8 @@ def _list_arp_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsArpTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsArpTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsArpTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsArpTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -456,7 +453,6 @@ def _list_arp_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,7 +479,7 @@ def begin_list_arp_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsArpTableListResult"] """Gets the currently advertised ARP table associated with the express route cross connection in a resource group. @@ -554,8 +550,8 @@ def _list_routes_table_summary_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + # type: (...) -> Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -579,7 +575,6 @@ def _list_routes_table_summary_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -606,7 +601,7 @@ def begin_list_routes_table_summary( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult"] """Gets the route table summary associated with the express route cross connection in a resource group. @@ -677,8 +672,8 @@ def _list_routes_table_initial( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ExpressRouteCircuitsRoutesTableListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitsRoutesTableListResult"] + # type: (...) -> Optional["models.ExpressRouteCircuitsRoutesTableListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ExpressRouteCircuitsRoutesTableListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -702,7 +697,6 @@ def _list_routes_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -729,7 +723,7 @@ def begin_list_routes_table( device_path, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRouteCircuitsRoutesTableListResult"] """Gets the currently advertised routes table associated with the express route cross connection in a resource group. 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 4f4471e2a90c..f3d18d181bc0 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 @@ -78,7 +78,6 @@ def list_by_subscription( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -131,7 +130,6 @@ def list_by_resource_group( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,7 +178,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(put_express_route_gateway_parameters, 'ExpressRouteGateway') body_content_kwargs['content'] = body_content @@ -193,7 +190,6 @@ 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('ExpressRouteGateway', pipeline_response) @@ -213,7 +209,7 @@ def begin_create_or_update( put_express_route_gateway_parameters, # type: "models.ExpressRouteGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -313,7 +309,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -358,7 +353,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -378,7 +372,7 @@ def begin_delete( express_route_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 700eea85fa20..6dc5ea0f4e18 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 56758e33488a..632a62dd1eac 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 @@ -65,6 +65,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -148,7 +148,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 a54ce25169ac..636930b6db1a 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( express_route_port_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ExpressRoutePort') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('ExpressRoutePort', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.ExpressRoutePort" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ExpressRoutePort"] """Creates or updates the specified ExpressRoutePort resource. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 df0e95521e31..12410385859b 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 @@ -63,6 +63,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -74,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 70204dc2eaae..d6c48d6a81d9 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( firewall_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('FirewallPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicy"] """Creates or updates the specified Firewall Policy. :param resource_group_name: The name of the resource group. @@ -355,6 +351,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -367,15 +367,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -420,6 +416,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -431,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8821fb8c6d56..597b1732333c 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FirewallPolicyRuleGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('FirewallPolicyRuleGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.FirewallPolicyRuleGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.FirewallPolicyRuleGroup"] """Creates or updates the specified FirewallPolicyRuleGroup. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 81362a72845a..5958fc45c1ec 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLog') body_content_kwargs['content'] = body_content @@ -95,7 +94,6 @@ def _create_or_update_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLog', pipeline_response) @@ -116,7 +114,7 @@ def begin_create_or_update( parameters, # type: "models.FlowLog" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -222,7 +220,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -270,7 +267,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -292,7 +288,7 @@ def begin_delete( flow_log_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified flow log resource. :param resource_group_name: The name of the resource group. @@ -372,6 +368,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -385,15 +385,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6f72bd91889f..f7bade7f360f 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 @@ -81,7 +81,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_table_parameters, 'HubRouteTable') body_content_kwargs['content'] = body_content @@ -94,7 +93,6 @@ 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('HubRouteTable', pipeline_response) @@ -115,7 +113,7 @@ def begin_create_or_update( route_table_parameters, # type: "models.HubRouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -221,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,7 +265,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +285,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a RouteTable. :param resource_group_name: The resource group name of the RouteTable. @@ -369,6 +365,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3ef4dc1bb5cd..a567f2c89c7e 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 de887f6d8f8d..fba355f4f312 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 @@ -71,6 +71,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -149,7 +149,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,7 +169,7 @@ def begin_delete( inbound_nat_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -275,7 +274,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,7 +324,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') body_content_kwargs['content'] = body_content @@ -339,7 +336,6 @@ 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('InboundNatRule', pipeline_response) @@ -360,7 +356,7 @@ def begin_create_or_update( inbound_nat_rule_parameters, # type: "models.InboundNatRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.InboundNatRule"] """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. 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 3608bd1810ff..a2917071179c 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( ip_allocation_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified IpAllocation. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpAllocation') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('IpAllocation', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.IpAllocation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.IpAllocation"] """Creates or updates an IpAllocation in the specified resource group. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e6dbaa7f2582..4dd2d8ca78f4 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 @@ -93,7 +93,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpGroup') body_content_kwargs['content'] = body_content @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('IpGroup', pipeline_response) @@ -177,7 +174,7 @@ def begin_create_or_update( parameters, # type: "models.IpGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.IpGroup"] """Creates or updates an ipGroups in a specified resource group. :param resource_group_name: The name of the resource group. @@ -281,7 +278,6 @@ def update_groups( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -331,7 +327,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -352,7 +347,7 @@ def begin_delete( ip_groups_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ipGroups. :param resource_group_name: The name of the resource group. @@ -426,6 +421,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -438,15 +437,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -492,6 +487,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -503,15 +502,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6f01efb03943..62906b335d4a 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 @@ -71,6 +71,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -84,15 +88,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -163,7 +163,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -214,7 +213,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'BackendAddressPool') body_content_kwargs['content'] = body_content @@ -227,7 +225,6 @@ 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('BackendAddressPool', pipeline_response) @@ -248,7 +245,7 @@ def begin_create_or_update( parameters, # type: "models.BackendAddressPool" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BackendAddressPool"] """Creates or updates a load balancer backend address pool. :param resource_group_name: The name of the resource group. @@ -341,7 +338,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -362,7 +358,7 @@ def begin_delete( backend_address_pool_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer backend address pool. :param resource_group_name: The name of the resource group. 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 efa183624c1e..bfb8e7eda459 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 cfed7d66a2d9..62950fa5683b 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e1ed4c42c989..80a0a51958aa 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a11fa49ac471..32431606aaff 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 e2a133319160..6af630046cac 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 734d208d6284..66d9f8951274 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( load_balancer_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LoadBalancer') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('LoadBalancer', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.LoadBalancer" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.LoadBalancer"] """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3b71c7f5fd9b..9f57cfc0173e 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LocalNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('LocalNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.LocalNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( local_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -416,6 +411,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8958c992d09c..404502cdbab5 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( nat_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified nat gateway. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NatGateway') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.NatGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NatGateway"] """Creates or updates a nat gateway. :param resource_group_name: The name of the resource group. @@ -382,7 +378,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -488,6 +483,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -500,15 +499,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 5e3273e52b12..5eb873821a84 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -161,7 +161,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 f015f57f96a8..eeb4b03562e2 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 @@ -69,6 +69,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +86,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b07f4fdf3f99..02e7ef04b24c 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( tap_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified tap configuration from the NetworkInterface. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_configuration_parameters, 'NetworkInterfaceTapConfiguration') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('NetworkInterfaceTapConfiguration', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( tap_configuration_parameters, # type: "models.NetworkInterfaceTapConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterfaceTapConfiguration"] """Creates or updates a Tap configuration in the specified NetworkInterface. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e06e316efa32..f1d05a8f7ea0 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkInterface') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkInterface', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkInterface" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkInterface"] """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -538,8 +533,8 @@ def _get_effective_route_table_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveRouteListResult"] + # type: (...) -> Optional["models.EffectiveRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -561,7 +556,6 @@ def _get_effective_route_table_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -586,7 +580,7 @@ def begin_get_effective_route_table( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveRouteListResult"] """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -648,8 +642,8 @@ def _list_effective_network_security_groups_initial( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EffectiveNetworkSecurityGroupListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.EffectiveNetworkSecurityGroupListResult"] + # type: (...) -> Optional["models.EffectiveNetworkSecurityGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EffectiveNetworkSecurityGroupListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -671,7 +665,6 @@ def _list_effective_network_security_groups_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -696,7 +689,7 @@ def begin_list_effective_network_security_groups( network_interface_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EffectiveNetworkSecurityGroupListResult"] """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -780,6 +773,10 @@ def list_virtual_machine_scale_set_vm_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore @@ -794,15 +791,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -853,6 +846,10 @@ def list_virtual_machine_scale_set_network_interfaces( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore @@ -866,15 +863,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -954,7 +947,6 @@ def get_virtual_machine_scale_set_network_interface( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1004,6 +996,10 @@ def list_virtual_machine_scale_set_ip_configurations( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] # type: ignore @@ -1021,15 +1017,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1113,7 +1105,6 @@ def get_virtual_machine_scale_set_ip_configuration( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 ddc766631bf6..22dda203366c 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 @@ -34,8 +34,8 @@ def _put_bastion_shareable_link_initial( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> "models.BastionShareableLinkListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + # type: (...) -> Optional["models.BastionShareableLinkListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionShareableLinkListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -59,7 +59,6 @@ def _put_bastion_shareable_link_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -89,7 +88,7 @@ def begin_put_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["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. @@ -179,7 +178,6 @@ def _delete_bastion_shareable_link_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(bsl_request, 'BastionShareableLinkListRequest') body_content_kwargs['content'] = body_content @@ -204,7 +202,7 @@ def begin_delete_bastion_shareable_link( bsl_request, # type: "models.BastionShareableLinkListRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -288,6 +286,11 @@ def get_bastion_shareable_link( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.get_bastion_shareable_link.metadata['url'] # type: ignore @@ -301,19 +304,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -347,8 +349,8 @@ def _get_active_sessions_initial( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.BastionActiveSessionListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BastionActiveSessionListResult"] + # type: (...) -> Optional["models.BastionActiveSessionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BastionActiveSessionListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -370,7 +372,6 @@ def _get_active_sessions_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +396,7 @@ def begin_get_active_sessions( bastion_host_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BastionActiveSessionListResult"] """Returns the list of currently active sessions on the Bastion. :param resource_group_name: The name of the resource group. @@ -479,6 +480,11 @@ def disconnect_active_sessions( content_type = "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'] = 'application/json' + if not next_link: # Construct URL url = self.disconnect_active_sessions.metadata['url'] # type: ignore @@ -492,19 +498,18 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' - - # Construct and send request - 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) + 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 @@ -573,7 +578,6 @@ def check_dns_name_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -631,7 +635,6 @@ def supported_security_providers( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -655,8 +658,8 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -680,7 +683,6 @@ def _generatevirtualwanvpnserverconfigurationvpnprofile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_client_params, 'VirtualWanVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -710,7 +712,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile( vpn_client_params, # type: "models.VirtualWanVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnProfileResponse"] """Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group. 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 5d235f3a666e..7c27b2540c82 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network profile. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkProfile') body_content_kwargs['content'] = body_content @@ -268,7 +265,6 @@ def create_or_update( 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('NetworkProfile', pipeline_response) @@ -326,7 +322,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -365,6 +360,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -376,15 +375,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -432,6 +427,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 32d7b972692b..32703469ffe8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_security_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('NetworkSecurityGroup', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkSecurityGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 d2a4f841654c..c8fafda87602 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( network_virtual_appliance_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -255,7 +253,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -308,7 +305,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkVirtualAppliance') body_content_kwargs['content'] = body_content @@ -321,7 +317,6 @@ 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('NetworkVirtualAppliance', pipeline_response) @@ -341,7 +336,7 @@ def begin_create_or_update( parameters, # type: "models.NetworkVirtualAppliance" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NetworkVirtualAppliance"] """Creates or updates the specified Network Virtual Appliance. :param resource_group_name: The name of the resource group. @@ -421,6 +416,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 3af23e87572f..8922ed1003aa 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 @@ -92,7 +92,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkWatcher') body_content_kwargs['content'] = body_content @@ -106,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkWatcher', pipeline_response) @@ -159,7 +157,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,7 +202,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -226,7 +222,7 @@ def begin_delete( network_watcher_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -324,7 +320,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -367,6 +362,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -379,15 +378,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -433,6 +428,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -444,15 +443,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -525,7 +520,6 @@ def get_topology( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TopologyParameters') body_content_kwargs['content'] = body_content @@ -579,7 +573,6 @@ def _verify_ip_flow_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') body_content_kwargs['content'] = body_content @@ -593,7 +586,6 @@ def _verify_ip_flow_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) @@ -613,7 +605,7 @@ def begin_verify_ip_flow( parameters, # type: "models.VerificationIPFlowParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -704,7 +696,6 @@ def _get_next_hop_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NextHopParameters') body_content_kwargs['content'] = body_content @@ -718,7 +709,6 @@ def _get_next_hop_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NextHopResult', pipeline_response) @@ -738,7 +728,7 @@ def begin_get_next_hop( parameters, # type: "models.NextHopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NextHopResult"] """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -829,7 +819,6 @@ def _get_vm_security_rules_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') body_content_kwargs['content'] = body_content @@ -843,7 +832,6 @@ def _get_vm_security_rules_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) @@ -863,7 +851,7 @@ def begin_get_vm_security_rules( parameters, # type: "models.SecurityGroupViewParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -954,7 +942,6 @@ def _get_troubleshooting_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -968,7 +955,6 @@ def _get_troubleshooting_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -988,7 +974,7 @@ def begin_get_troubleshooting( parameters, # type: "models.TroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -1079,7 +1065,6 @@ def _get_troubleshooting_result_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') body_content_kwargs['content'] = body_content @@ -1093,7 +1078,6 @@ def _get_troubleshooting_result_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('TroubleshootingResult', pipeline_response) @@ -1113,7 +1097,7 @@ def begin_get_troubleshooting_result( parameters, # type: "models.QueryTroubleshootingParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.TroubleshootingResult"] """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1204,7 +1188,6 @@ def _set_flow_log_configuration_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogInformation') body_content_kwargs['content'] = body_content @@ -1218,7 +1201,6 @@ def _set_flow_log_configuration_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1238,7 +1220,7 @@ def begin_set_flow_log_configuration( parameters, # type: "models.FlowLogInformation" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1329,7 +1311,6 @@ def _get_flow_log_status_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') body_content_kwargs['content'] = body_content @@ -1343,7 +1324,6 @@ def _get_flow_log_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('FlowLogInformation', pipeline_response) @@ -1363,7 +1343,7 @@ def begin_get_flow_log_status( parameters, # type: "models.FlowLogStatusParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1455,7 +1435,6 @@ def _check_connectivity_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectivityParameters') body_content_kwargs['content'] = body_content @@ -1469,7 +1448,6 @@ def _check_connectivity_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ConnectivityInformation', pipeline_response) @@ -1489,7 +1467,7 @@ def begin_check_connectivity( parameters, # type: "models.ConnectivityParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1581,7 +1559,6 @@ def _get_azure_reachability_report_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') body_content_kwargs['content'] = body_content @@ -1595,7 +1572,6 @@ def _get_azure_reachability_report_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureReachabilityReport', pipeline_response) @@ -1615,7 +1591,7 @@ def begin_get_azure_reachability_report( parameters, # type: "models.AzureReachabilityReportParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1708,7 +1684,6 @@ def _list_available_providers_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') body_content_kwargs['content'] = body_content @@ -1722,7 +1697,6 @@ def _list_available_providers_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AvailableProvidersList', pipeline_response) @@ -1742,7 +1716,7 @@ def begin_list_available_providers( parameters, # type: "models.AvailableProvidersListParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1834,7 +1808,6 @@ def _get_network_configuration_diagnostic_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkConfigurationDiagnosticParameters') body_content_kwargs['content'] = body_content @@ -1848,7 +1821,6 @@ def _get_network_configuration_diagnostic_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NetworkConfigurationDiagnosticResponse', pipeline_response) @@ -1868,7 +1840,7 @@ def begin_get_network_configuration_diagnostic( parameters, # type: "models.NetworkConfigurationDiagnosticParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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 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 7f02e3fd12a1..a31e339a77f4 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 @@ -63,6 +63,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8a8e5ec09331..7add8ee9b70b 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'P2SVpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('P2SVpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( p2_s_vpn_gateway_parameters, # type: "models.P2SVpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -275,7 +272,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(p2_s_vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -324,7 +320,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -344,7 +339,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan p2s vpn gateway. :param resource_group_name: The resource group name of the P2SVpnGateway. @@ -418,6 +413,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -483,6 +478,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -494,15 +493,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -536,8 +531,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnProfileResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnProfileResponse"] + # type: (...) -> Optional["models.VpnProfileResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnProfileResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -561,7 +556,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'P2SVpnProfileParameters') body_content_kwargs['content'] = body_content @@ -591,7 +585,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.P2SVpnProfileParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -657,8 +651,8 @@ def _get_p2_s_vpn_connection_health_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + # type: (...) -> Optional["models.P2SVpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -680,7 +674,6 @@ def _get_p2_s_vpn_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -705,7 +698,7 @@ def begin_get_p2_s_vpn_connection_health( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.P2SVpnGateway"] """Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. @@ -769,8 +762,8 @@ def _get_p2_s_vpn_connection_health_detailed_initial( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> "models.P2SVpnConnectionHealth" - cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnConnectionHealth"] + # type: (...) -> Optional["models.P2SVpnConnectionHealth"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.P2SVpnConnectionHealth"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -794,7 +787,6 @@ def _get_p2_s_vpn_connection_health_detailed_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionHealthRequest') body_content_kwargs['content'] = body_content @@ -824,7 +816,7 @@ def begin_get_p2_s_vpn_connection_health_detailed( request, # type: "models.P2SVpnConnectionHealthRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -915,7 +907,6 @@ def _disconnect_p2_s_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -940,7 +931,7 @@ def begin_disconnect_p2_s_vpn_connections( request, # type: "models.P2SVpnConnectionRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. 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 76bfb7cdb622..cfd31fa7db1f 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 @@ -81,7 +81,6 @@ def _create_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PacketCapture') body_content_kwargs['content'] = body_content @@ -111,7 +110,7 @@ def begin_create( parameters, # type: "models.PacketCapture" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureResult"] """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -217,7 +216,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -265,7 +263,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +284,7 @@ def begin_delete( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -373,7 +370,6 @@ def _stop_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -395,7 +391,7 @@ def begin_stop( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -482,7 +478,6 @@ def _get_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -492,7 +487,6 @@ def _get_status_initial( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) @@ -512,7 +506,7 @@ def begin_get_status( packet_capture_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PacketCaptureQueryStatusResult"] """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -595,6 +589,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -608,15 +606,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 27d2ff176bf7..fe63e3620bcb 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 @@ -94,7 +94,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -139,6 +138,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -153,15 +156,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 31275496f815..be15e303ec87 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( private_dns_zone_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private dns zone group. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateDnsZoneGroup') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('PrivateDnsZoneGroup', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateDnsZoneGroup" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9606e2a4296e..ff1ca5db2861 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( private_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private endpoint. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpoint') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateEndpoint', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpoint" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b2773cc69fb0..d834c6e4200e 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( service_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified private link service. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateLinkService') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('PrivateLinkService', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateLinkService" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -358,6 +354,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list_by_subscription( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -521,7 +517,6 @@ def get_private_endpoint_connection( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -588,7 +583,6 @@ def update_private_endpoint_connection( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content @@ -640,7 +634,6 @@ def _delete_private_endpoint_connection_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -662,7 +655,7 @@ def begin_delete_private_endpoint_connection( pe_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -742,6 +735,10 @@ def list_private_endpoint_connections( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_private_endpoint_connections.metadata['url'] # type: ignore @@ -755,15 +752,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -791,32 +784,21 @@ def get_next(next_link=None): ) list_private_endpoint_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections'} # type: ignore - def check_private_link_service_visibility( + def _check_private_link_service_visibility_initial( self, location, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "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_04_01.models.CheckPrivateLinkServiceVisibilityRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceVisibility"] + # type: (...) -> Optional["models.PrivateLinkServiceVisibility"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateLinkServiceVisibility"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility.metadata['url'] # type: ignore + 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'), @@ -832,7 +814,6 @@ def check_private_link_service_visibility( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -841,48 +822,98 @@ def check_private_link_service_visibility( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _check_private_link_service_visibility_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore - def check_private_link_service_visibility_by_resource_group( + def begin_check_private_link_service_visibility( self, location, # type: str - resource_group_name, # type: str parameters, # type: "models.CheckPrivateLinkServiceVisibilityRequest" **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkServiceVisibility" - """Checks whether the subscription is visible to private link service in the specified resource - group. + # 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 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_04_01.models.CheckPrivateLinkServiceVisibilityRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: PrivateLinkServiceVisibility, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2020_04_01.models.PrivateLinkServiceVisibility - :raises: ~azure.core.exceptions.HttpResponseError + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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_04_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.check_private_link_service_visibility_by_resource_group.metadata['url'] # type: ignore + 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'), @@ -899,7 +930,6 @@ def check_private_link_service_visibility_by_resource_group( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckPrivateLinkServiceVisibilityRequest') body_content_kwargs['content'] = body_content @@ -908,17 +938,86 @@ def check_private_link_service_visibility_by_resource_group( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + 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 = self._deserialize('PrivateLinkServiceVisibility', pipeline_response) + 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'} # type: ignore + _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_04_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_04_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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, @@ -942,6 +1041,10 @@ def list_auto_approved_private_link_services( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services.metadata['url'] # type: ignore @@ -954,15 +1057,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1014,6 +1113,10 @@ def list_auto_approved_private_link_services_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_auto_approved_private_link_services_by_resource_group.metadata['url'] # type: ignore @@ -1027,15 +1130,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cbe6d3683dd3..8f74d650cdbc 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_address_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPAddress') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPAddress', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPAddress" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPAddress"] """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -556,6 +551,10 @@ def list_virtual_machine_scale_set_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore @@ -569,15 +568,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -638,6 +633,10 @@ def list_virtual_machine_scale_set_vm_public_ip_addresses( api_version = "2018-10-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore @@ -654,15 +653,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -750,7 +745,6 @@ def get_virtual_machine_scale_set_public_ip_address( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 d5c26e7c9c97..fefa5314051f 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( public_ip_prefix_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified public IP prefix. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PublicIPPrefix') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('PublicIPPrefix', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.PublicIPPrefix" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PublicIPPrefix"] """Creates or updates a static or dynamic public IP prefix. :param resource_group_name: The name of the resource group. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 6b796d0ad46d..2b97e1387575 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 099a6130dd93..7bddab8f7fc8 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('RouteFilterRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_filter_rule_parameters, # type: "models.RouteFilterRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.RouteFilterRule"] """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list_by_route_filter( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_route_filter.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 851ef1dd6188..6d73cc22f17b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteFilter', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( route_filter_parameters, # type: "models.RouteFilter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -422,6 +417,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -434,15 +433,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -487,6 +482,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 7c24b301815e..9736ffa9d5e8 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RouteTable') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('RouteTable', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.RouteTable" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -421,6 +416,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -433,15 +432,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 899df05573cd..7af46588c2a6 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( route_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(route_parameters, 'Route') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('Route', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( route_parameters, # type: "models.Route" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Route"] """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -369,6 +365,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -382,15 +382,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 b8cbb665fb1b..c7aca45b43c6 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( security_partner_provider_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SecurityPartnerProvider') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('SecurityPartnerProvider', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.SecurityPartnerProvider" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.SecurityPartnerProvider"] """Creates or updates the specified Security Partner Provider. :param resource_group_name: The name of the resource group. @@ -375,7 +371,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -417,6 +412,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -482,6 +477,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -493,15 +492,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 535ffbd9726e..c3077a42797f 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( security_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('SecurityRule', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( security_rule_parameters, # type: "models.SecurityRule" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -370,6 +366,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 043b1f9b76cc..4977b3b8456c 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 @@ -88,7 +88,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 06b3cec154b2..045390809c9d 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( service_endpoint_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified service endpoint policy. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceEndpointPolicy') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('ServiceEndpointPolicy', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.ServiceEndpointPolicy" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicy"] """Creates or updates a service Endpoint Policies. :param resource_group_name: The name of the resource group. @@ -380,7 +376,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -419,6 +414,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -430,15 +429,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -486,6 +481,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -498,15 +497,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 675f607ef87e..828c6344c1cc 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( service_endpoint_policy_definition_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified ServiceEndpoint policy definitions. :param resource_group_name: The name of the resource group. @@ -200,7 +199,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') body_content_kwargs['content'] = body_content @@ -264,7 +261,6 @@ 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('ServiceEndpointPolicyDefinition', pipeline_response) @@ -285,7 +281,7 @@ def begin_create_or_update( service_endpoint_policy_definitions, # type: "models.ServiceEndpointPolicyDefinition" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ServiceEndpointPolicyDefinition"] """Creates or updates a service endpoint policy definition in the specified service endpoint policy. @@ -374,6 +370,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 f9bdf3fc48b6..852ffb73e63e 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 @@ -82,7 +82,6 @@ def list( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 004a8e054e55..d245e3b35d46 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( subnet_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -203,7 +202,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +252,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(subnet_parameters, 'Subnet') body_content_kwargs['content'] = body_content @@ -267,7 +264,6 @@ 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('Subnet', pipeline_response) @@ -288,7 +284,7 @@ def begin_create_or_update( subnet_parameters, # type: "models.Subnet" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Subnet"] """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -383,7 +379,6 @@ def _prepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(prepare_network_policies_request_parameters, 'PrepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -409,7 +404,7 @@ def begin_prepare_network_policies( prepare_network_policies_request_parameters, # type: "models.PrepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Prepares a subnet by applying network intent policies. :param resource_group_name: The name of the resource group. @@ -502,7 +497,6 @@ def _unprepare_network_policies_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(unprepare_network_policies_request_parameters, 'UnprepareNetworkPoliciesRequest') body_content_kwargs['content'] = body_content @@ -528,7 +522,7 @@ def begin_unprepare_network_policies( unprepare_network_policies_request_parameters, # type: "models.UnprepareNetworkPoliciesRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Unprepares a subnet by removing network intent policies. :param resource_group_name: The name of the resource group. @@ -612,6 +606,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -625,15 +623,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 77c0ed3e4b09..d3aa8c449866 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 @@ -66,6 +66,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +82,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 ae89f9a1c5a5..c992cb906449 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -143,7 +142,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request 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 @@ -157,7 +155,6 @@ def _create_or_update_initial( 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('VirtualHubRouteTableV2', pipeline_response) @@ -178,7 +175,7 @@ def begin_create_or_update( virtual_hub_route_table_v2_parameters, # type: "models.VirtualHubRouteTableV2" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualHubRouteTableV2"] """Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. @@ -272,7 +269,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,7 +290,7 @@ def begin_delete( route_table_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHubRouteTableV2. :param resource_group_name: The resource group name of the VirtualHubRouteTableV2. @@ -374,6 +370,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -387,15 +387,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8b06cd57a9f7..9e279606ea21 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'VirtualHub') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualHub', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( virtual_hub_parameters, # type: "models.VirtualHub" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_hub_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualHub. :param resource_group_name: The resource group name of the VirtualHub. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 9bb4216d5535..d912012f8ef7 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGatewayConnection', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGatewayConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -214,7 +212,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +256,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +275,7 @@ def begin_delete( virtual_network_gateway_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -340,8 +336,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + # type: (...) -> Optional["models.VirtualNetworkGatewayConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGatewayConnection"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -365,7 +361,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -395,7 +390,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGatewayConnection"] """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -487,7 +482,6 @@ def _set_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionSharedKey') body_content_kwargs['content'] = body_content @@ -500,7 +494,6 @@ def _set_shared_key_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('ConnectionSharedKey', pipeline_response) @@ -520,7 +513,7 @@ def begin_set_shared_key( parameters, # type: "models.ConnectionSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -624,7 +617,6 @@ def get_shared_key( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,6 +655,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -675,15 +671,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -717,8 +709,8 @@ def _reset_shared_key_initial( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> "models.ConnectionResetSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionResetSharedKey"] + # type: (...) -> Optional["models.ConnectionResetSharedKey"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ConnectionResetSharedKey"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -742,7 +734,6 @@ def _reset_shared_key_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') body_content_kwargs['content'] = body_content @@ -772,7 +763,7 @@ def begin_reset_shared_key( parameters, # type: "models.ConnectionResetSharedKey" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -842,8 +833,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -867,7 +858,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -901,7 +891,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -969,8 +959,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -994,7 +984,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -1025,7 +1014,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 c00c198dfc04..8cbadaedac0f 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 @@ -79,7 +79,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') body_content_kwargs['content'] = body_content @@ -92,7 +91,6 @@ 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('VirtualNetworkGateway', pipeline_response) @@ -112,7 +110,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -211,7 +209,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -256,7 +253,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,7 +272,7 @@ def begin_delete( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -336,8 +332,8 @@ def _update_tags_initial( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -361,7 +357,6 @@ def _update_tags_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -391,7 +386,7 @@ def begin_update_tags( parameters, # type: "models.TagsObject" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkGateway"] """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -471,6 +466,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -483,15 +482,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -542,6 +537,10 @@ def list_connections( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_connections.metadata['url'] # type: ignore @@ -555,15 +554,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -597,8 +592,8 @@ def _reset_initial( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + # type: (...) -> Optional["models.VirtualNetworkGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualNetworkGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -622,7 +617,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -648,7 +642,7 @@ def begin_reset( gateway_vip=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -736,7 +730,6 @@ def _reset_vpn_client_shared_key_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -756,7 +749,7 @@ def begin_reset_vpn_client_shared_key( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Resets the VPN client shared key of the virtual network gateway in the specified resource group. @@ -817,8 +810,8 @@ def _generatevpnclientpackage_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -842,7 +835,6 @@ def _generatevpnclientpackage_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -872,7 +864,7 @@ def begin_generatevpnclientpackage( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[str] """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -940,8 +932,8 @@ def _generate_vpn_profile_initial( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -965,7 +957,6 @@ def _generate_vpn_profile_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnClientParameters') body_content_kwargs['content'] = body_content @@ -995,7 +986,7 @@ def begin_generate_vpn_profile( parameters, # type: "models.VpnClientParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1062,8 +1053,8 @@ def _get_vpn_profile_package_url_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1085,7 +1076,6 @@ def _get_vpn_profile_package_url_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1110,7 +1100,7 @@ def begin_get_vpn_profile_package_url( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1174,8 +1164,8 @@ def _get_bgp_peer_status_initial( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BgpPeerStatusListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.BgpPeerStatusListResult"] + # type: (...) -> Optional["models.BgpPeerStatusListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.BgpPeerStatusListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1199,7 +1189,6 @@ def _get_bgp_peer_status_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1225,7 +1214,7 @@ def begin_get_bgp_peer_status( peer=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.BgpPeerStatusListResult"] """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1324,7 +1313,6 @@ def supported_vpn_devices( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1347,8 +1335,8 @@ def _get_learned_routes_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1370,7 +1358,6 @@ def _get_learned_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1395,7 +1382,7 @@ def begin_get_learned_routes( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1459,8 +1446,8 @@ def _get_advertised_routes_initial( peer, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GatewayRouteListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.GatewayRouteListResult"] + # type: (...) -> Optional["models.GatewayRouteListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.GatewayRouteListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1483,7 +1470,6 @@ def _get_advertised_routes_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1509,7 +1495,7 @@ def begin_get_advertised_routes( peer, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.GatewayRouteListResult"] """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1576,8 +1562,8 @@ def _set_vpnclient_ipsec_parameters_initial( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> "models.VpnClientIPsecParameters" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientIPsecParameters"] + # type: (...) -> Optional["models.VpnClientIPsecParameters"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientIPsecParameters"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1601,7 +1587,6 @@ def _set_vpnclient_ipsec_parameters_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpnclient_ipsec_params, 'VpnClientIPsecParameters') body_content_kwargs['content'] = body_content @@ -1631,7 +1616,7 @@ def begin_set_vpnclient_ipsec_parameters( vpnclient_ipsec_params, # type: "models.VpnClientIPsecParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1721,7 +1706,6 @@ def _get_vpnclient_ipsec_parameters_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1744,7 +1728,7 @@ def begin_get_vpnclient_ipsec_parameters( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -1848,7 +1832,6 @@ def vpn_device_configuration_script( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') body_content_kwargs['content'] = body_content @@ -1876,8 +1859,8 @@ def _start_packet_capture_initial( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -1901,7 +1884,6 @@ def _start_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] if parameters is not None: body_content = self._serialize.body(parameters, 'VpnPacketCaptureStartParameters') @@ -1935,7 +1917,7 @@ def begin_start_packet_capture( parameters=None, # type: Optional["models.VpnPacketCaptureStartParameters"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2002,8 +1984,8 @@ def _stop_packet_capture_initial( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> str - cls = kwargs.pop('cls', None) # type: ClsType[str] + # type: (...) -> Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -2027,7 +2009,6 @@ def _stop_packet_capture_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VpnPacketCaptureStopParameters') body_content_kwargs['content'] = body_content @@ -2058,7 +2039,7 @@ def begin_stop_packet_capture( parameters, # type: "models.VpnPacketCaptureStopParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -2124,8 +2105,8 @@ def _get_vpnclient_connection_health_initial( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnClientConnectionHealthDetailListResult" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnClientConnectionHealthDetailListResult"] + # type: (...) -> Optional["models.VpnClientConnectionHealthDetailListResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnClientConnectionHealthDetailListResult"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -2147,7 +2128,6 @@ def _get_vpnclient_connection_health_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2172,7 +2152,7 @@ def begin_get_vpnclient_connection_health( virtual_network_gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnClientConnectionHealthDetailListResult"] """Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group. @@ -2260,7 +2240,6 @@ def _disconnect_virtual_network_gateway_vpn_connections_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'P2SVpnConnectionRequest') body_content_kwargs['content'] = body_content @@ -2285,7 +2264,7 @@ def begin_disconnect_virtual_network_gateway_vpn_connections( request, # type: "models.P2SVpnConnectionRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 2d4e77940cd3..b9e3410b4432 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -98,7 +97,7 @@ def begin_delete( virtual_network_peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -198,7 +197,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -249,7 +247,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') body_content_kwargs['content'] = body_content @@ -262,7 +259,6 @@ 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('VirtualNetworkPeering', pipeline_response) @@ -283,7 +279,7 @@ def begin_create_or_update( virtual_network_peering_parameters, # type: "models.VirtualNetworkPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkPeering"] """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -370,6 +366,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 161f3a8abfbb..656c50e906f4 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( tap_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network tap. :param resource_group_name: The name of the resource group. @@ -188,7 +187,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,7 +235,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkTap') body_content_kwargs['content'] = body_content @@ -250,7 +247,6 @@ 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('VirtualNetworkTap', pipeline_response) @@ -270,7 +266,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetworkTap" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualNetworkTap"] """Creates or updates a Virtual Network Tap. :param resource_group_name: The name of the resource group. @@ -374,7 +370,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(tap_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -413,6 +408,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -424,15 +423,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -480,6 +475,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4dab4f2c79c5..f01a64336e1b 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,7 +94,7 @@ def begin_delete( virtual_network_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -193,7 +192,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,7 +240,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetwork') body_content_kwargs['content'] = body_content @@ -255,7 +252,6 @@ 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('VirtualNetwork', pipeline_response) @@ -275,7 +271,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualNetwork" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -379,7 +375,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -418,6 +413,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -429,15 +428,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -497,15 +496,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -576,7 +571,6 @@ def check_ip_address_availability( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -617,6 +611,10 @@ def list_usage( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_usage.metadata['url'] # type: ignore @@ -630,15 +628,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 cfb55b209743..d4172b5e36c4 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 @@ -77,7 +77,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +98,7 @@ def begin_delete( peering_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified peering from a Virtual Router. :param resource_group_name: The name of the resource group. @@ -199,7 +198,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,7 +249,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouterPeering') body_content_kwargs['content'] = body_content @@ -265,7 +262,6 @@ def _create_or_update_initial( 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('VirtualRouterPeering', pipeline_response) @@ -286,7 +282,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouterPeering" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouterPeering"] """Creates or updates the specified Virtual Router Peering. :param resource_group_name: The name of the resource group. @@ -373,6 +369,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -386,15 +386,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 4cbf95656d65..dc9f6006e807 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 @@ -75,7 +75,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,7 +95,7 @@ def begin_delete( virtual_router_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -194,7 +193,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,7 +242,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualRouter') body_content_kwargs['content'] = body_content @@ -258,7 +255,6 @@ def _create_or_update_initial( 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('VirtualRouter', pipeline_response) @@ -278,7 +274,7 @@ def begin_create_or_update( parameters, # type: "models.VirtualRouter" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VirtualRouter"] """Creates or updates the specified Virtual Router. :param resource_group_name: The name of the resource group. @@ -358,6 +354,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -370,15 +370,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -424,6 +420,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -435,15 +435,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 a0632f876f31..7f084d6c33c3 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'VirtualWAN') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VirtualWAN', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( wan_parameters, # type: "models.VirtualWAN" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(wan_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VirtualWAN. :param resource_group_name: The resource group name of the VirtualWan. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 26e5609ad0f3..e9c416916216 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 @@ -91,7 +91,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -142,7 +141,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_connection_parameters, 'VpnConnection') body_content_kwargs['content'] = body_content @@ -155,7 +153,6 @@ 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('VpnConnection', pipeline_response) @@ -176,7 +173,7 @@ def begin_create_or_update( vpn_connection_parameters, # type: "models.VpnConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnConnection"] """Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @@ -269,7 +266,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -290,7 +286,7 @@ def begin_delete( connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a vpn connection. :param resource_group_name: The resource group name of the VpnGateway. @@ -370,6 +366,10 @@ def list_by_vpn_gateway( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_gateway.metadata['url'] # type: ignore @@ -383,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1d3087e606ed..7f83ebf3b7ef 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'VpnGateway') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnGateway', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_gateway_parameters, # type: "models.VpnGateway" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -274,7 +271,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_gateway_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -323,7 +319,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,7 +338,7 @@ def begin_delete( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a virtual wan vpn gateway. :param resource_group_name: The resource group name of the VpnGateway. @@ -402,8 +397,8 @@ def _reset_initial( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnGateway" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + # type: (...) -> Optional["models.VpnGateway"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnGateway"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -425,7 +420,6 @@ def _reset_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -450,7 +444,7 @@ def begin_reset( gateway_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -527,6 +521,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -539,15 +537,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -592,6 +586,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -603,15 +601,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 29dd71ec6c44..ba721795f0aa 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 @@ -73,6 +73,10 @@ def list_by_vpn_connection( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_connection.metadata['url'] # type: ignore @@ -87,15 +91,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 e57aba0ac78e..5d5b0834f4ac 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 @@ -52,8 +52,8 @@ def _list_initial( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VpnServerConfigurationsResponse" - cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfigurationsResponse"] + # type: (...) -> Optional["models.VpnServerConfigurationsResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VpnServerConfigurationsResponse"]] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) api_version = "2020-04-01" @@ -75,7 +75,6 @@ def _list_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +99,7 @@ def begin_list( virtual_wan_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 ed7d698ad703..3980248ce9a6 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'VpnServerConfiguration') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnServerConfiguration', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_server_configuration_parameters, # type: "models.VpnServerConfiguration" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.VpnServerConfiguration"] """Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. @@ -277,7 +274,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_server_configuration_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -326,7 +322,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -346,7 +341,7 @@ def begin_delete( vpn_server_configuration_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnServerConfiguration. :param resource_group_name: The resource group name of the VpnServerConfiguration. @@ -420,6 +415,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -432,15 +431,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -485,6 +480,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -496,15 +495,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 49625da8e4c1..3ed78d0758c4 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 @@ -92,7 +92,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response 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 c3083d5f8c29..f32c986a3016 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 @@ -89,7 +89,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -130,6 +129,10 @@ def list_by_vpn_site( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_vpn_site.metadata['url'] # type: ignore @@ -143,15 +146,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 8e3f117b9b6b..3d9d9e637b81 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 @@ -77,7 +77,6 @@ def _download_initial( header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(request, 'GetVpnSitesConfigurationRequest') body_content_kwargs['content'] = body_content @@ -102,7 +101,7 @@ def begin_download( request, # type: "models.GetVpnSitesConfigurationRequest" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. 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 e4631ddf54dd..716d85b3b5d0 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 @@ -87,7 +87,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -136,7 +135,6 @@ def _create_or_update_initial( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'VpnSite') body_content_kwargs['content'] = body_content @@ -149,7 +147,6 @@ 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('VpnSite', pipeline_response) @@ -169,7 +166,7 @@ def begin_create_or_update( vpn_site_parameters, # type: "models.VpnSite" **kwargs # type: Any ): - # type: (...) -> LROPoller + # 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. @@ -273,7 +270,6 @@ def update_tags( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(vpn_site_parameters, 'TagsObject') body_content_kwargs['content'] = body_content @@ -322,7 +318,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -342,7 +337,7 @@ def begin_delete( vpn_site_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a VpnSite. :param resource_group_name: The resource group name of the VpnSite. @@ -416,6 +411,10 @@ def list_by_resource_group( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -428,15 +427,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -481,6 +476,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -492,15 +491,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): 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 1b767eb02042..1778e39e0f0b 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 @@ -68,6 +68,10 @@ def list( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -80,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -133,6 +133,10 @@ def list_all( api_version = "2020-04-01" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + if not next_link: # Construct URL url = self.list_all.metadata['url'] # type: ignore @@ -144,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -219,7 +219,6 @@ def get( header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -281,7 +280,6 @@ def create_or_update( header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = 'application/json' - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'WebApplicationFirewallPolicy') body_content_kwargs['content'] = body_content @@ -294,7 +292,6 @@ def create_or_update( 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('WebApplicationFirewallPolicy', pipeline_response) @@ -335,7 +332,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,7 +351,7 @@ def begin_delete( policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes Policy. :param resource_group_name: The name of the resource group. diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/__init__.py new file mode 100644 index 000000000000..c66f95f71169 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_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 + patch_sdk() +except ImportError: + pass diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_configuration.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_configuration.py new file mode 100644 index 000000000000..8c619e0340c2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_configuration.py @@ -0,0 +1,68 @@ +# 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 + +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 = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + 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.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_05_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_metadata.json new file mode 100644 index 000000000000..47075b2514a5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_metadata.json @@ -0,0 +1,285 @@ +{ + "chosen_version": "2020-05-01", + "total_api_version_list": ["2018-10-01", "2020-05-01"], + "client": { + "name": "NetworkManagementClient", + "filename": "_network_management_client", + "description": "Network Client." + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_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", + "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": { + "credential": { + "method_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", + "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"] + }, + "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", + "bastion_hosts": "BastionHostsOperations", + "ddos_custom_policies": "DdosCustomPoliciesOperations", + "ddos_protection_plans": "DdosProtectionPlansOperations", + "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", + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "async": { + "signature": "async 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[\"models.BastionShareableLinkListResult\"]:\n", + "coroutine": true + }, + "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:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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: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" + }, + "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" + }, + "async": { + "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", + "coroutine": false + }, + "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: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_05_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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "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" + }, + "async": { + "signature": "async def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.BastionActiveSessionListResult\"]:\n", + "coroutine": true + }, + "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:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~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" + }, + "async": { + "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", + "coroutine": false + }, + "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: BastionSessionDeleteResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_05_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" + }, + "async": { + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "coroutine": true + }, + "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" + }, + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~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" + } + }, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"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\": [\"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_05_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_network_management_client.py new file mode 100644 index 000000000000..4c4627b8e004 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/_network_management_client.py @@ -0,0 +1,570 @@ +# 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 BastionHostsOperations +from .operations import NetworkManagementClientOperationsMixin +from .operations import DdosCustomPoliciesOperations +from .operations import DdosProtectionPlansOperations +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 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_05_01.operations.ApplicationGatewaysOperations + :ivar application_gateway_private_link_resources: ApplicationGatewayPrivateLinkResourcesOperations operations + :vartype application_gateway_private_link_resources: azure.mgmt.network.v2020_05_01.operations.ApplicationGatewayPrivateLinkResourcesOperations + :ivar application_gateway_private_endpoint_connections: ApplicationGatewayPrivateEndpointConnectionsOperations operations + :vartype application_gateway_private_endpoint_connections: azure.mgmt.network.v2020_05_01.operations.ApplicationGatewayPrivateEndpointConnectionsOperations + :ivar application_security_groups: ApplicationSecurityGroupsOperations operations + :vartype application_security_groups: azure.mgmt.network.v2020_05_01.operations.ApplicationSecurityGroupsOperations + :ivar available_delegations: AvailableDelegationsOperations operations + :vartype available_delegations: azure.mgmt.network.v2020_05_01.operations.AvailableDelegationsOperations + :ivar available_resource_group_delegations: AvailableResourceGroupDelegationsOperations operations + :vartype available_resource_group_delegations: azure.mgmt.network.v2020_05_01.operations.AvailableResourceGroupDelegationsOperations + :ivar available_service_aliases: AvailableServiceAliasesOperations operations + :vartype available_service_aliases: azure.mgmt.network.v2020_05_01.operations.AvailableServiceAliasesOperations + :ivar azure_firewalls: AzureFirewallsOperations operations + :vartype azure_firewalls: azure.mgmt.network.v2020_05_01.operations.AzureFirewallsOperations + :ivar azure_firewall_fqdn_tags: AzureFirewallFqdnTagsOperations operations + :vartype azure_firewall_fqdn_tags: azure.mgmt.network.v2020_05_01.operations.AzureFirewallFqdnTagsOperations + :ivar bastion_hosts: BastionHostsOperations operations + :vartype bastion_hosts: azure.mgmt.network.v2020_05_01.operations.BastionHostsOperations + :ivar ddos_custom_policies: DdosCustomPoliciesOperations operations + :vartype ddos_custom_policies: azure.mgmt.network.v2020_05_01.operations.DdosCustomPoliciesOperations + :ivar ddos_protection_plans: DdosProtectionPlansOperations operations + :vartype ddos_protection_plans: azure.mgmt.network.v2020_05_01.operations.DdosProtectionPlansOperations + :ivar available_endpoint_services: AvailableEndpointServicesOperations operations + :vartype available_endpoint_services: azure.mgmt.network.v2020_05_01.operations.AvailableEndpointServicesOperations + :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations operations + :vartype express_route_circuit_authorizations: azure.mgmt.network.v2020_05_01.operations.ExpressRouteCircuitAuthorizationsOperations + :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations + :vartype express_route_circuit_peerings: azure.mgmt.network.v2020_05_01.operations.ExpressRouteCircuitPeeringsOperations + :ivar express_route_circuit_connections: ExpressRouteCircuitConnectionsOperations operations + :vartype express_route_circuit_connections: azure.mgmt.network.v2020_05_01.operations.ExpressRouteCircuitConnectionsOperations + :ivar peer_express_route_circuit_connections: PeerExpressRouteCircuitConnectionsOperations operations + :vartype peer_express_route_circuit_connections: azure.mgmt.network.v2020_05_01.operations.PeerExpressRouteCircuitConnectionsOperations + :ivar express_route_circuits: ExpressRouteCircuitsOperations operations + :vartype express_route_circuits: azure.mgmt.network.v2020_05_01.operations.ExpressRouteCircuitsOperations + :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations + :vartype express_route_service_providers: azure.mgmt.network.v2020_05_01.operations.ExpressRouteServiceProvidersOperations + :ivar express_route_cross_connections: ExpressRouteCrossConnectionsOperations operations + :vartype express_route_cross_connections: azure.mgmt.network.v2020_05_01.operations.ExpressRouteCrossConnectionsOperations + :ivar express_route_cross_connection_peerings: ExpressRouteCrossConnectionPeeringsOperations operations + :vartype express_route_cross_connection_peerings: azure.mgmt.network.v2020_05_01.operations.ExpressRouteCrossConnectionPeeringsOperations + :ivar express_route_ports_locations: ExpressRoutePortsLocationsOperations operations + :vartype express_route_ports_locations: azure.mgmt.network.v2020_05_01.operations.ExpressRoutePortsLocationsOperations + :ivar express_route_ports: ExpressRoutePortsOperations operations + :vartype express_route_ports: azure.mgmt.network.v2020_05_01.operations.ExpressRoutePortsOperations + :ivar express_route_links: ExpressRouteLinksOperations operations + :vartype express_route_links: azure.mgmt.network.v2020_05_01.operations.ExpressRouteLinksOperations + :ivar firewall_policies: FirewallPoliciesOperations operations + :vartype firewall_policies: azure.mgmt.network.v2020_05_01.operations.FirewallPoliciesOperations + :ivar firewall_policy_rule_collection_groups: FirewallPolicyRuleCollectionGroupsOperations operations + :vartype firewall_policy_rule_collection_groups: azure.mgmt.network.v2020_05_01.operations.FirewallPolicyRuleCollectionGroupsOperations + :ivar ip_allocations: IpAllocationsOperations operations + :vartype ip_allocations: azure.mgmt.network.v2020_05_01.operations.IpAllocationsOperations + :ivar ip_groups: IpGroupsOperations operations + :vartype ip_groups: azure.mgmt.network.v2020_05_01.operations.IpGroupsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: azure.mgmt.network.v2020_05_01.operations.LoadBalancersOperations + :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations + :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2020_05_01.operations.LoadBalancerBackendAddressPoolsOperations + :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations operations + :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2020_05_01.operations.LoadBalancerFrontendIPConfigurationsOperations + :ivar inbound_nat_rules: InboundNatRulesOperations operations + :vartype inbound_nat_rules: azure.mgmt.network.v2020_05_01.operations.InboundNatRulesOperations + :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations + :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2020_05_01.operations.LoadBalancerLoadBalancingRulesOperations + :ivar load_balancer_outbound_rules: LoadBalancerOutboundRulesOperations operations + :vartype load_balancer_outbound_rules: azure.mgmt.network.v2020_05_01.operations.LoadBalancerOutboundRulesOperations + :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations + :vartype load_balancer_network_interfaces: azure.mgmt.network.v2020_05_01.operations.LoadBalancerNetworkInterfacesOperations + :ivar load_balancer_probes: LoadBalancerProbesOperations operations + :vartype load_balancer_probes: azure.mgmt.network.v2020_05_01.operations.LoadBalancerProbesOperations + :ivar nat_gateways: NatGatewaysOperations operations + :vartype nat_gateways: azure.mgmt.network.v2020_05_01.operations.NatGatewaysOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: azure.mgmt.network.v2020_05_01.operations.NetworkInterfacesOperations + :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations operations + :vartype network_interface_ip_configurations: azure.mgmt.network.v2020_05_01.operations.NetworkInterfaceIPConfigurationsOperations + :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations + :vartype network_interface_load_balancers: azure.mgmt.network.v2020_05_01.operations.NetworkInterfaceLoadBalancersOperations + :ivar network_interface_tap_configurations: NetworkInterfaceTapConfigurationsOperations operations + :vartype network_interface_tap_configurations: azure.mgmt.network.v2020_05_01.operations.NetworkInterfaceTapConfigurationsOperations + :ivar network_profiles: NetworkProfilesOperations operations + :vartype network_profiles: azure.mgmt.network.v2020_05_01.operations.NetworkProfilesOperations + :ivar network_security_groups: NetworkSecurityGroupsOperations operations + :vartype network_security_groups: azure.mgmt.network.v2020_05_01.operations.NetworkSecurityGroupsOperations + :ivar security_rules: SecurityRulesOperations operations + :vartype security_rules: azure.mgmt.network.v2020_05_01.operations.SecurityRulesOperations + :ivar default_security_rules: DefaultSecurityRulesOperations operations + :vartype default_security_rules: azure.mgmt.network.v2020_05_01.operations.DefaultSecurityRulesOperations + :ivar network_virtual_appliances: NetworkVirtualAppliancesOperations operations + :vartype network_virtual_appliances: azure.mgmt.network.v2020_05_01.operations.NetworkVirtualAppliancesOperations + :ivar virtual_appliance_sites: VirtualApplianceSitesOperations operations + :vartype virtual_appliance_sites: azure.mgmt.network.v2020_05_01.operations.VirtualApplianceSitesOperations + :ivar virtual_appliance_skus: VirtualApplianceSkusOperations operations + :vartype virtual_appliance_skus: azure.mgmt.network.v2020_05_01.operations.VirtualApplianceSkusOperations + :ivar network_watchers: NetworkWatchersOperations operations + :vartype network_watchers: azure.mgmt.network.v2020_05_01.operations.NetworkWatchersOperations + :ivar packet_captures: PacketCapturesOperations operations + :vartype packet_captures: azure.mgmt.network.v2020_05_01.operations.PacketCapturesOperations + :ivar connection_monitors: ConnectionMonitorsOperations operations + :vartype connection_monitors: azure.mgmt.network.v2020_05_01.operations.ConnectionMonitorsOperations + :ivar flow_logs: FlowLogsOperations operations + :vartype flow_logs: azure.mgmt.network.v2020_05_01.operations.FlowLogsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.network.v2020_05_01.operations.Operations + :ivar private_endpoints: PrivateEndpointsOperations operations + :vartype private_endpoints: azure.mgmt.network.v2020_05_01.operations.PrivateEndpointsOperations + :ivar available_private_endpoint_types: AvailablePrivateEndpointTypesOperations operations + :vartype available_private_endpoint_types: azure.mgmt.network.v2020_05_01.operations.AvailablePrivateEndpointTypesOperations + :ivar private_dns_zone_groups: PrivateDnsZoneGroupsOperations operations + :vartype private_dns_zone_groups: azure.mgmt.network.v2020_05_01.operations.PrivateDnsZoneGroupsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: azure.mgmt.network.v2020_05_01.operations.PrivateLinkServicesOperations + :ivar public_ip_addresses: PublicIPAddressesOperations operations + :vartype public_ip_addresses: azure.mgmt.network.v2020_05_01.operations.PublicIPAddressesOperations + :ivar public_ip_prefixes: PublicIPPrefixesOperations operations + :vartype public_ip_prefixes: azure.mgmt.network.v2020_05_01.operations.PublicIPPrefixesOperations + :ivar route_filters: RouteFiltersOperations operations + :vartype route_filters: azure.mgmt.network.v2020_05_01.operations.RouteFiltersOperations + :ivar route_filter_rules: RouteFilterRulesOperations operations + :vartype route_filter_rules: azure.mgmt.network.v2020_05_01.operations.RouteFilterRulesOperations + :ivar route_tables: RouteTablesOperations operations + :vartype route_tables: azure.mgmt.network.v2020_05_01.operations.RouteTablesOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.network.v2020_05_01.operations.RoutesOperations + :ivar security_partner_providers: SecurityPartnerProvidersOperations operations + :vartype security_partner_providers: azure.mgmt.network.v2020_05_01.operations.SecurityPartnerProvidersOperations + :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations + :vartype bgp_service_communities: azure.mgmt.network.v2020_05_01.operations.BgpServiceCommunitiesOperations + :ivar service_endpoint_policies: ServiceEndpointPoliciesOperations operations + :vartype service_endpoint_policies: azure.mgmt.network.v2020_05_01.operations.ServiceEndpointPoliciesOperations + :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitionsOperations operations + :vartype service_endpoint_policy_definitions: azure.mgmt.network.v2020_05_01.operations.ServiceEndpointPolicyDefinitionsOperations + :ivar service_tags: ServiceTagsOperations operations + :vartype service_tags: azure.mgmt.network.v2020_05_01.operations.ServiceTagsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.network.v2020_05_01.operations.UsagesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: azure.mgmt.network.v2020_05_01.operations.VirtualNetworksOperations + :ivar subnets: SubnetsOperations operations + :vartype subnets: azure.mgmt.network.v2020_05_01.operations.SubnetsOperations + :ivar resource_navigation_links: ResourceNavigationLinksOperations operations + :vartype resource_navigation_links: azure.mgmt.network.v2020_05_01.operations.ResourceNavigationLinksOperations + :ivar service_association_links: ServiceAssociationLinksOperations operations + :vartype service_association_links: azure.mgmt.network.v2020_05_01.operations.ServiceAssociationLinksOperations + :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations + :vartype virtual_network_peerings: azure.mgmt.network.v2020_05_01.operations.VirtualNetworkPeeringsOperations + :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations + :vartype virtual_network_gateways: azure.mgmt.network.v2020_05_01.operations.VirtualNetworkGatewaysOperations + :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations operations + :vartype virtual_network_gateway_connections: azure.mgmt.network.v2020_05_01.operations.VirtualNetworkGatewayConnectionsOperations + :ivar local_network_gateways: LocalNetworkGatewaysOperations operations + :vartype local_network_gateways: azure.mgmt.network.v2020_05_01.operations.LocalNetworkGatewaysOperations + :ivar virtual_network_taps: VirtualNetworkTapsOperations operations + :vartype virtual_network_taps: azure.mgmt.network.v2020_05_01.operations.VirtualNetworkTapsOperations + :ivar virtual_routers: VirtualRoutersOperations operations + :vartype virtual_routers: azure.mgmt.network.v2020_05_01.operations.VirtualRoutersOperations + :ivar virtual_router_peerings: VirtualRouterPeeringsOperations operations + :vartype virtual_router_peerings: azure.mgmt.network.v2020_05_01.operations.VirtualRouterPeeringsOperations + :ivar virtual_wans: VirtualWansOperations operations + :vartype virtual_wans: azure.mgmt.network.v2020_05_01.operations.VirtualWansOperations + :ivar vpn_sites: VpnSitesOperations operations + :vartype vpn_sites: azure.mgmt.network.v2020_05_01.operations.VpnSitesOperations + :ivar vpn_site_links: VpnSiteLinksOperations operations + :vartype vpn_site_links: azure.mgmt.network.v2020_05_01.operations.VpnSiteLinksOperations + :ivar vpn_sites_configuration: VpnSitesConfigurationOperations operations + :vartype vpn_sites_configuration: azure.mgmt.network.v2020_05_01.operations.VpnSitesConfigurationOperations + :ivar vpn_server_configurations: VpnServerConfigurationsOperations operations + :vartype vpn_server_configurations: azure.mgmt.network.v2020_05_01.operations.VpnServerConfigurationsOperations + :ivar virtual_hubs: VirtualHubsOperations operations + :vartype virtual_hubs: azure.mgmt.network.v2020_05_01.operations.VirtualHubsOperations + :ivar hub_virtual_network_connections: HubVirtualNetworkConnectionsOperations operations + :vartype hub_virtual_network_connections: azure.mgmt.network.v2020_05_01.operations.HubVirtualNetworkConnectionsOperations + :ivar vpn_gateways: VpnGatewaysOperations operations + :vartype vpn_gateways: azure.mgmt.network.v2020_05_01.operations.VpnGatewaysOperations + :ivar vpn_connections: VpnConnectionsOperations operations + :vartype vpn_connections: azure.mgmt.network.v2020_05_01.operations.VpnConnectionsOperations + :ivar vpn_site_link_connections: VpnSiteLinkConnectionsOperations operations + :vartype vpn_site_link_connections: azure.mgmt.network.v2020_05_01.operations.VpnSiteLinkConnectionsOperations + :ivar vpn_link_connections: VpnLinkConnectionsOperations operations + :vartype vpn_link_connections: azure.mgmt.network.v2020_05_01.operations.VpnLinkConnectionsOperations + :ivar p2_svpn_gateways: P2SVpnGatewaysOperations operations + :vartype p2_svpn_gateways: azure.mgmt.network.v2020_05_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_05_01.operations.VpnServerConfigurationsAssociatedWithVirtualWanOperations + :ivar virtual_hub_route_table_v2_s: VirtualHubRouteTableV2SOperations operations + :vartype virtual_hub_route_table_v2_s: azure.mgmt.network.v2020_05_01.operations.VirtualHubRouteTableV2SOperations + :ivar express_route_gateways: ExpressRouteGatewaysOperations operations + :vartype express_route_gateways: azure.mgmt.network.v2020_05_01.operations.ExpressRouteGatewaysOperations + :ivar express_route_connections: ExpressRouteConnectionsOperations operations + :vartype express_route_connections: azure.mgmt.network.v2020_05_01.operations.ExpressRouteConnectionsOperations + :ivar virtual_hub_bgp_connection: VirtualHubBgpConnectionOperations operations + :vartype virtual_hub_bgp_connection: azure.mgmt.network.v2020_05_01.operations.VirtualHubBgpConnectionOperations + :ivar virtual_hub_bgp_connections: VirtualHubBgpConnectionsOperations operations + :vartype virtual_hub_bgp_connections: azure.mgmt.network.v2020_05_01.operations.VirtualHubBgpConnectionsOperations + :ivar virtual_hub_ip_configuration: VirtualHubIpConfigurationOperations operations + :vartype virtual_hub_ip_configuration: azure.mgmt.network.v2020_05_01.operations.VirtualHubIpConfigurationOperations + :ivar hub_route_tables: HubRouteTablesOperations operations + :vartype hub_route_tables: azure.mgmt.network.v2020_05_01.operations.HubRouteTablesOperations + :ivar web_application_firewall_policies: WebApplicationFirewallPoliciesOperations operations + :vartype web_application_firewall_policies: azure.mgmt.network.v2020_05_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.bastion_hosts = BastionHostsOperations( + 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.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.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_05_01/aio/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/__init__.py new file mode 100644 index 000000000000..4ea3e127918e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_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_async import NetworkManagementClient +__all__ = ['NetworkManagementClient'] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_configuration_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_configuration_async.py new file mode 100644 index 000000000000..65df074fa469 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_configuration_async.py @@ -0,0 +1,64 @@ +# 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 + +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 = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + 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.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_05_01/aio/_network_management_client_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_network_management_client_async.py new file mode 100644 index 000000000000..2172160518a0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/_network_management_client_async.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 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_async import NetworkManagementClientConfiguration +from .operations_async import ApplicationGatewaysOperations +from .operations_async import ApplicationGatewayPrivateLinkResourcesOperations +from .operations_async import ApplicationGatewayPrivateEndpointConnectionsOperations +from .operations_async import ApplicationSecurityGroupsOperations +from .operations_async import AvailableDelegationsOperations +from .operations_async import AvailableResourceGroupDelegationsOperations +from .operations_async import AvailableServiceAliasesOperations +from .operations_async import AzureFirewallsOperations +from .operations_async import AzureFirewallFqdnTagsOperations +from .operations_async import BastionHostsOperations +from .operations_async import NetworkManagementClientOperationsMixin +from .operations_async import DdosCustomPoliciesOperations +from .operations_async import DdosProtectionPlansOperations +from .operations_async import AvailableEndpointServicesOperations +from .operations_async import ExpressRouteCircuitAuthorizationsOperations +from .operations_async import ExpressRouteCircuitPeeringsOperations +from .operations_async import ExpressRouteCircuitConnectionsOperations +from .operations_async import PeerExpressRouteCircuitConnectionsOperations +from .operations_async import ExpressRouteCircuitsOperations +from .operations_async import ExpressRouteServiceProvidersOperations +from .operations_async import ExpressRouteCrossConnectionsOperations +from .operations_async import ExpressRouteCrossConnectionPeeringsOperations +from .operations_async import ExpressRoutePortsLocationsOperations +from .operations_async import ExpressRoutePortsOperations +from .operations_async import ExpressRouteLinksOperations +from .operations_async import FirewallPoliciesOperations +from .operations_async import FirewallPolicyRuleCollectionGroupsOperations +from .operations_async import IpAllocationsOperations +from .operations_async import IpGroupsOperations +from .operations_async import LoadBalancersOperations +from .operations_async import LoadBalancerBackendAddressPoolsOperations +from .operations_async import LoadBalancerFrontendIPConfigurationsOperations +from .operations_async import InboundNatRulesOperations +from .operations_async import LoadBalancerLoadBalancingRulesOperations +from .operations_async import LoadBalancerOutboundRulesOperations +from .operations_async import LoadBalancerNetworkInterfacesOperations +from .operations_async import LoadBalancerProbesOperations +from .operations_async import NatGatewaysOperations +from .operations_async import NetworkInterfacesOperations +from .operations_async import NetworkInterfaceIPConfigurationsOperations +from .operations_async import NetworkInterfaceLoadBalancersOperations +from .operations_async import NetworkInterfaceTapConfigurationsOperations +from .operations_async import NetworkProfilesOperations +from .operations_async import NetworkSecurityGroupsOperations +from .operations_async import SecurityRulesOperations +from .operations_async import DefaultSecurityRulesOperations +from .operations_async import NetworkVirtualAppliancesOperations +from .operations_async import VirtualApplianceSitesOperations +from .operations_async import VirtualApplianceSkusOperations +from .operations_async import NetworkWatchersOperations +from .operations_async import PacketCapturesOperations +from .operations_async import ConnectionMonitorsOperations +from .operations_async import FlowLogsOperations +from .operations_async import Operations +from .operations_async import PrivateEndpointsOperations +from .operations_async import AvailablePrivateEndpointTypesOperations +from .operations_async import PrivateDnsZoneGroupsOperations +from .operations_async import PrivateLinkServicesOperations +from .operations_async import PublicIPAddressesOperations +from .operations_async import PublicIPPrefixesOperations +from .operations_async import RouteFiltersOperations +from .operations_async import RouteFilterRulesOperations +from .operations_async import RouteTablesOperations +from .operations_async import RoutesOperations +from .operations_async import SecurityPartnerProvidersOperations +from .operations_async import BgpServiceCommunitiesOperations +from .operations_async import ServiceEndpointPoliciesOperations +from .operations_async import ServiceEndpointPolicyDefinitionsOperations +from .operations_async import ServiceTagsOperations +from .operations_async import UsagesOperations +from .operations_async import VirtualNetworksOperations +from .operations_async import SubnetsOperations +from .operations_async import ResourceNavigationLinksOperations +from .operations_async import ServiceAssociationLinksOperations +from .operations_async import VirtualNetworkPeeringsOperations +from .operations_async import VirtualNetworkGatewaysOperations +from .operations_async import VirtualNetworkGatewayConnectionsOperations +from .operations_async import LocalNetworkGatewaysOperations +from .operations_async import VirtualNetworkTapsOperations +from .operations_async import VirtualRoutersOperations +from .operations_async import VirtualRouterPeeringsOperations +from .operations_async import VirtualWansOperations +from .operations_async import VpnSitesOperations +from .operations_async import VpnSiteLinksOperations +from .operations_async import VpnSitesConfigurationOperations +from .operations_async import VpnServerConfigurationsOperations +from .operations_async import VirtualHubsOperations +from .operations_async import HubVirtualNetworkConnectionsOperations +from .operations_async import VpnGatewaysOperations +from .operations_async import VpnConnectionsOperations +from .operations_async import VpnSiteLinkConnectionsOperations +from .operations_async import VpnLinkConnectionsOperations +from .operations_async import P2SVpnGatewaysOperations +from .operations_async import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from .operations_async import VirtualHubRouteTableV2SOperations +from .operations_async import ExpressRouteGatewaysOperations +from .operations_async import ExpressRouteConnectionsOperations +from .operations_async import VirtualHubBgpConnectionOperations +from .operations_async import VirtualHubBgpConnectionsOperations +from .operations_async import VirtualHubIpConfigurationOperations +from .operations_async import HubRouteTablesOperations +from .operations_async import WebApplicationFirewallPoliciesOperations +from .. import models + + +class NetworkManagementClient(NetworkManagementClientOperationsMixin): + """Network Client. + + :ivar application_gateways: ApplicationGatewaysOperations operations + :vartype application_gateways: azure.mgmt.network.v2020_05_01.aio.operations_async.ApplicationGatewaysOperations + :ivar application_gateway_private_link_resources: ApplicationGatewayPrivateLinkResourcesOperations operations + :vartype application_gateway_private_link_resources: azure.mgmt.network.v2020_05_01.aio.operations_async.ApplicationGatewayPrivateLinkResourcesOperations + :ivar application_gateway_private_endpoint_connections: ApplicationGatewayPrivateEndpointConnectionsOperations operations + :vartype application_gateway_private_endpoint_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.ApplicationGatewayPrivateEndpointConnectionsOperations + :ivar application_security_groups: ApplicationSecurityGroupsOperations operations + :vartype application_security_groups: azure.mgmt.network.v2020_05_01.aio.operations_async.ApplicationSecurityGroupsOperations + :ivar available_delegations: AvailableDelegationsOperations operations + :vartype available_delegations: azure.mgmt.network.v2020_05_01.aio.operations_async.AvailableDelegationsOperations + :ivar available_resource_group_delegations: AvailableResourceGroupDelegationsOperations operations + :vartype available_resource_group_delegations: azure.mgmt.network.v2020_05_01.aio.operations_async.AvailableResourceGroupDelegationsOperations + :ivar available_service_aliases: AvailableServiceAliasesOperations operations + :vartype available_service_aliases: azure.mgmt.network.v2020_05_01.aio.operations_async.AvailableServiceAliasesOperations + :ivar azure_firewalls: AzureFirewallsOperations operations + :vartype azure_firewalls: azure.mgmt.network.v2020_05_01.aio.operations_async.AzureFirewallsOperations + :ivar azure_firewall_fqdn_tags: AzureFirewallFqdnTagsOperations operations + :vartype azure_firewall_fqdn_tags: azure.mgmt.network.v2020_05_01.aio.operations_async.AzureFirewallFqdnTagsOperations + :ivar bastion_hosts: BastionHostsOperations operations + :vartype bastion_hosts: azure.mgmt.network.v2020_05_01.aio.operations_async.BastionHostsOperations + :ivar ddos_custom_policies: DdosCustomPoliciesOperations operations + :vartype ddos_custom_policies: azure.mgmt.network.v2020_05_01.aio.operations_async.DdosCustomPoliciesOperations + :ivar ddos_protection_plans: DdosProtectionPlansOperations operations + :vartype ddos_protection_plans: azure.mgmt.network.v2020_05_01.aio.operations_async.DdosProtectionPlansOperations + :ivar available_endpoint_services: AvailableEndpointServicesOperations operations + :vartype available_endpoint_services: azure.mgmt.network.v2020_05_01.aio.operations_async.AvailableEndpointServicesOperations + :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations operations + :vartype express_route_circuit_authorizations: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteCircuitAuthorizationsOperations + :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations + :vartype express_route_circuit_peerings: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteCircuitPeeringsOperations + :ivar express_route_circuit_connections: ExpressRouteCircuitConnectionsOperations operations + :vartype express_route_circuit_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteCircuitConnectionsOperations + :ivar peer_express_route_circuit_connections: PeerExpressRouteCircuitConnectionsOperations operations + :vartype peer_express_route_circuit_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.PeerExpressRouteCircuitConnectionsOperations + :ivar express_route_circuits: ExpressRouteCircuitsOperations operations + :vartype express_route_circuits: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteCircuitsOperations + :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations + :vartype express_route_service_providers: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteServiceProvidersOperations + :ivar express_route_cross_connections: ExpressRouteCrossConnectionsOperations operations + :vartype express_route_cross_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteCrossConnectionsOperations + :ivar express_route_cross_connection_peerings: ExpressRouteCrossConnectionPeeringsOperations operations + :vartype express_route_cross_connection_peerings: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteCrossConnectionPeeringsOperations + :ivar express_route_ports_locations: ExpressRoutePortsLocationsOperations operations + :vartype express_route_ports_locations: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRoutePortsLocationsOperations + :ivar express_route_ports: ExpressRoutePortsOperations operations + :vartype express_route_ports: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRoutePortsOperations + :ivar express_route_links: ExpressRouteLinksOperations operations + :vartype express_route_links: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteLinksOperations + :ivar firewall_policies: FirewallPoliciesOperations operations + :vartype firewall_policies: azure.mgmt.network.v2020_05_01.aio.operations_async.FirewallPoliciesOperations + :ivar firewall_policy_rule_collection_groups: FirewallPolicyRuleCollectionGroupsOperations operations + :vartype firewall_policy_rule_collection_groups: azure.mgmt.network.v2020_05_01.aio.operations_async.FirewallPolicyRuleCollectionGroupsOperations + :ivar ip_allocations: IpAllocationsOperations operations + :vartype ip_allocations: azure.mgmt.network.v2020_05_01.aio.operations_async.IpAllocationsOperations + :ivar ip_groups: IpGroupsOperations operations + :vartype ip_groups: azure.mgmt.network.v2020_05_01.aio.operations_async.IpGroupsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: azure.mgmt.network.v2020_05_01.aio.operations_async.LoadBalancersOperations + :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations + :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2020_05_01.aio.operations_async.LoadBalancerBackendAddressPoolsOperations + :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations operations + :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2020_05_01.aio.operations_async.LoadBalancerFrontendIPConfigurationsOperations + :ivar inbound_nat_rules: InboundNatRulesOperations operations + :vartype inbound_nat_rules: azure.mgmt.network.v2020_05_01.aio.operations_async.InboundNatRulesOperations + :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations + :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2020_05_01.aio.operations_async.LoadBalancerLoadBalancingRulesOperations + :ivar load_balancer_outbound_rules: LoadBalancerOutboundRulesOperations operations + :vartype load_balancer_outbound_rules: azure.mgmt.network.v2020_05_01.aio.operations_async.LoadBalancerOutboundRulesOperations + :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations + :vartype load_balancer_network_interfaces: azure.mgmt.network.v2020_05_01.aio.operations_async.LoadBalancerNetworkInterfacesOperations + :ivar load_balancer_probes: LoadBalancerProbesOperations operations + :vartype load_balancer_probes: azure.mgmt.network.v2020_05_01.aio.operations_async.LoadBalancerProbesOperations + :ivar nat_gateways: NatGatewaysOperations operations + :vartype nat_gateways: azure.mgmt.network.v2020_05_01.aio.operations_async.NatGatewaysOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: azure.mgmt.network.v2020_05_01.aio.operations_async.NetworkInterfacesOperations + :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations operations + :vartype network_interface_ip_configurations: azure.mgmt.network.v2020_05_01.aio.operations_async.NetworkInterfaceIPConfigurationsOperations + :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations + :vartype network_interface_load_balancers: azure.mgmt.network.v2020_05_01.aio.operations_async.NetworkInterfaceLoadBalancersOperations + :ivar network_interface_tap_configurations: NetworkInterfaceTapConfigurationsOperations operations + :vartype network_interface_tap_configurations: azure.mgmt.network.v2020_05_01.aio.operations_async.NetworkInterfaceTapConfigurationsOperations + :ivar network_profiles: NetworkProfilesOperations operations + :vartype network_profiles: azure.mgmt.network.v2020_05_01.aio.operations_async.NetworkProfilesOperations + :ivar network_security_groups: NetworkSecurityGroupsOperations operations + :vartype network_security_groups: azure.mgmt.network.v2020_05_01.aio.operations_async.NetworkSecurityGroupsOperations + :ivar security_rules: SecurityRulesOperations operations + :vartype security_rules: azure.mgmt.network.v2020_05_01.aio.operations_async.SecurityRulesOperations + :ivar default_security_rules: DefaultSecurityRulesOperations operations + :vartype default_security_rules: azure.mgmt.network.v2020_05_01.aio.operations_async.DefaultSecurityRulesOperations + :ivar network_virtual_appliances: NetworkVirtualAppliancesOperations operations + :vartype network_virtual_appliances: azure.mgmt.network.v2020_05_01.aio.operations_async.NetworkVirtualAppliancesOperations + :ivar virtual_appliance_sites: VirtualApplianceSitesOperations operations + :vartype virtual_appliance_sites: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualApplianceSitesOperations + :ivar virtual_appliance_skus: VirtualApplianceSkusOperations operations + :vartype virtual_appliance_skus: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualApplianceSkusOperations + :ivar network_watchers: NetworkWatchersOperations operations + :vartype network_watchers: azure.mgmt.network.v2020_05_01.aio.operations_async.NetworkWatchersOperations + :ivar packet_captures: PacketCapturesOperations operations + :vartype packet_captures: azure.mgmt.network.v2020_05_01.aio.operations_async.PacketCapturesOperations + :ivar connection_monitors: ConnectionMonitorsOperations operations + :vartype connection_monitors: azure.mgmt.network.v2020_05_01.aio.operations_async.ConnectionMonitorsOperations + :ivar flow_logs: FlowLogsOperations operations + :vartype flow_logs: azure.mgmt.network.v2020_05_01.aio.operations_async.FlowLogsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.network.v2020_05_01.aio.operations_async.Operations + :ivar private_endpoints: PrivateEndpointsOperations operations + :vartype private_endpoints: azure.mgmt.network.v2020_05_01.aio.operations_async.PrivateEndpointsOperations + :ivar available_private_endpoint_types: AvailablePrivateEndpointTypesOperations operations + :vartype available_private_endpoint_types: azure.mgmt.network.v2020_05_01.aio.operations_async.AvailablePrivateEndpointTypesOperations + :ivar private_dns_zone_groups: PrivateDnsZoneGroupsOperations operations + :vartype private_dns_zone_groups: azure.mgmt.network.v2020_05_01.aio.operations_async.PrivateDnsZoneGroupsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: azure.mgmt.network.v2020_05_01.aio.operations_async.PrivateLinkServicesOperations + :ivar public_ip_addresses: PublicIPAddressesOperations operations + :vartype public_ip_addresses: azure.mgmt.network.v2020_05_01.aio.operations_async.PublicIPAddressesOperations + :ivar public_ip_prefixes: PublicIPPrefixesOperations operations + :vartype public_ip_prefixes: azure.mgmt.network.v2020_05_01.aio.operations_async.PublicIPPrefixesOperations + :ivar route_filters: RouteFiltersOperations operations + :vartype route_filters: azure.mgmt.network.v2020_05_01.aio.operations_async.RouteFiltersOperations + :ivar route_filter_rules: RouteFilterRulesOperations operations + :vartype route_filter_rules: azure.mgmt.network.v2020_05_01.aio.operations_async.RouteFilterRulesOperations + :ivar route_tables: RouteTablesOperations operations + :vartype route_tables: azure.mgmt.network.v2020_05_01.aio.operations_async.RouteTablesOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.network.v2020_05_01.aio.operations_async.RoutesOperations + :ivar security_partner_providers: SecurityPartnerProvidersOperations operations + :vartype security_partner_providers: azure.mgmt.network.v2020_05_01.aio.operations_async.SecurityPartnerProvidersOperations + :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations + :vartype bgp_service_communities: azure.mgmt.network.v2020_05_01.aio.operations_async.BgpServiceCommunitiesOperations + :ivar service_endpoint_policies: ServiceEndpointPoliciesOperations operations + :vartype service_endpoint_policies: azure.mgmt.network.v2020_05_01.aio.operations_async.ServiceEndpointPoliciesOperations + :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitionsOperations operations + :vartype service_endpoint_policy_definitions: azure.mgmt.network.v2020_05_01.aio.operations_async.ServiceEndpointPolicyDefinitionsOperations + :ivar service_tags: ServiceTagsOperations operations + :vartype service_tags: azure.mgmt.network.v2020_05_01.aio.operations_async.ServiceTagsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.network.v2020_05_01.aio.operations_async.UsagesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualNetworksOperations + :ivar subnets: SubnetsOperations operations + :vartype subnets: azure.mgmt.network.v2020_05_01.aio.operations_async.SubnetsOperations + :ivar resource_navigation_links: ResourceNavigationLinksOperations operations + :vartype resource_navigation_links: azure.mgmt.network.v2020_05_01.aio.operations_async.ResourceNavigationLinksOperations + :ivar service_association_links: ServiceAssociationLinksOperations operations + :vartype service_association_links: azure.mgmt.network.v2020_05_01.aio.operations_async.ServiceAssociationLinksOperations + :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations + :vartype virtual_network_peerings: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualNetworkPeeringsOperations + :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations + :vartype virtual_network_gateways: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualNetworkGatewaysOperations + :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations operations + :vartype virtual_network_gateway_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualNetworkGatewayConnectionsOperations + :ivar local_network_gateways: LocalNetworkGatewaysOperations operations + :vartype local_network_gateways: azure.mgmt.network.v2020_05_01.aio.operations_async.LocalNetworkGatewaysOperations + :ivar virtual_network_taps: VirtualNetworkTapsOperations operations + :vartype virtual_network_taps: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualNetworkTapsOperations + :ivar virtual_routers: VirtualRoutersOperations operations + :vartype virtual_routers: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualRoutersOperations + :ivar virtual_router_peerings: VirtualRouterPeeringsOperations operations + :vartype virtual_router_peerings: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualRouterPeeringsOperations + :ivar virtual_wans: VirtualWansOperations operations + :vartype virtual_wans: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualWansOperations + :ivar vpn_sites: VpnSitesOperations operations + :vartype vpn_sites: azure.mgmt.network.v2020_05_01.aio.operations_async.VpnSitesOperations + :ivar vpn_site_links: VpnSiteLinksOperations operations + :vartype vpn_site_links: azure.mgmt.network.v2020_05_01.aio.operations_async.VpnSiteLinksOperations + :ivar vpn_sites_configuration: VpnSitesConfigurationOperations operations + :vartype vpn_sites_configuration: azure.mgmt.network.v2020_05_01.aio.operations_async.VpnSitesConfigurationOperations + :ivar vpn_server_configurations: VpnServerConfigurationsOperations operations + :vartype vpn_server_configurations: azure.mgmt.network.v2020_05_01.aio.operations_async.VpnServerConfigurationsOperations + :ivar virtual_hubs: VirtualHubsOperations operations + :vartype virtual_hubs: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualHubsOperations + :ivar hub_virtual_network_connections: HubVirtualNetworkConnectionsOperations operations + :vartype hub_virtual_network_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.HubVirtualNetworkConnectionsOperations + :ivar vpn_gateways: VpnGatewaysOperations operations + :vartype vpn_gateways: azure.mgmt.network.v2020_05_01.aio.operations_async.VpnGatewaysOperations + :ivar vpn_connections: VpnConnectionsOperations operations + :vartype vpn_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.VpnConnectionsOperations + :ivar vpn_site_link_connections: VpnSiteLinkConnectionsOperations operations + :vartype vpn_site_link_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.VpnSiteLinkConnectionsOperations + :ivar vpn_link_connections: VpnLinkConnectionsOperations operations + :vartype vpn_link_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.VpnLinkConnectionsOperations + :ivar p2_svpn_gateways: P2SVpnGatewaysOperations operations + :vartype p2_svpn_gateways: azure.mgmt.network.v2020_05_01.aio.operations_async.P2SVpnGatewaysOperations + :ivar vpn_server_configurations_associated_with_virtual_wan: VpnServerConfigurationsAssociatedWithVirtualWanOperations operations + :vartype vpn_server_configurations_associated_with_virtual_wan: azure.mgmt.network.v2020_05_01.aio.operations_async.VpnServerConfigurationsAssociatedWithVirtualWanOperations + :ivar virtual_hub_route_table_v2_s: VirtualHubRouteTableV2SOperations operations + :vartype virtual_hub_route_table_v2_s: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualHubRouteTableV2SOperations + :ivar express_route_gateways: ExpressRouteGatewaysOperations operations + :vartype express_route_gateways: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteGatewaysOperations + :ivar express_route_connections: ExpressRouteConnectionsOperations operations + :vartype express_route_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.ExpressRouteConnectionsOperations + :ivar virtual_hub_bgp_connection: VirtualHubBgpConnectionOperations operations + :vartype virtual_hub_bgp_connection: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualHubBgpConnectionOperations + :ivar virtual_hub_bgp_connections: VirtualHubBgpConnectionsOperations operations + :vartype virtual_hub_bgp_connections: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualHubBgpConnectionsOperations + :ivar virtual_hub_ip_configuration: VirtualHubIpConfigurationOperations operations + :vartype virtual_hub_ip_configuration: azure.mgmt.network.v2020_05_01.aio.operations_async.VirtualHubIpConfigurationOperations + :ivar hub_route_tables: HubRouteTablesOperations operations + :vartype hub_route_tables: azure.mgmt.network.v2020_05_01.aio.operations_async.HubRouteTablesOperations + :ivar web_application_firewall_policies: WebApplicationFirewallPoliciesOperations operations + :vartype web_application_firewall_policies: azure.mgmt.network.v2020_05_01.aio.operations_async.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.bastion_hosts = BastionHostsOperations( + 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.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.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_05_01/aio/operations_async/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/__init__.py new file mode 100644 index 000000000000..3ecedb3bbbd2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/__init__.py @@ -0,0 +1,215 @@ +# 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_async import ApplicationGatewaysOperations +from ._application_gateway_private_link_resources_operations_async import ApplicationGatewayPrivateLinkResourcesOperations +from ._application_gateway_private_endpoint_connections_operations_async import ApplicationGatewayPrivateEndpointConnectionsOperations +from ._application_security_groups_operations_async import ApplicationSecurityGroupsOperations +from ._available_delegations_operations_async import AvailableDelegationsOperations +from ._available_resource_group_delegations_operations_async import AvailableResourceGroupDelegationsOperations +from ._available_service_aliases_operations_async import AvailableServiceAliasesOperations +from ._azure_firewalls_operations_async import AzureFirewallsOperations +from ._azure_firewall_fqdn_tags_operations_async import AzureFirewallFqdnTagsOperations +from ._bastion_hosts_operations_async import BastionHostsOperations +from ._network_management_client_operations_async import NetworkManagementClientOperationsMixin +from ._ddos_custom_policies_operations_async import DdosCustomPoliciesOperations +from ._ddos_protection_plans_operations_async import DdosProtectionPlansOperations +from ._available_endpoint_services_operations_async import AvailableEndpointServicesOperations +from ._express_route_circuit_authorizations_operations_async import ExpressRouteCircuitAuthorizationsOperations +from ._express_route_circuit_peerings_operations_async import ExpressRouteCircuitPeeringsOperations +from ._express_route_circuit_connections_operations_async import ExpressRouteCircuitConnectionsOperations +from ._peer_express_route_circuit_connections_operations_async import PeerExpressRouteCircuitConnectionsOperations +from ._express_route_circuits_operations_async import ExpressRouteCircuitsOperations +from ._express_route_service_providers_operations_async import ExpressRouteServiceProvidersOperations +from ._express_route_cross_connections_operations_async import ExpressRouteCrossConnectionsOperations +from ._express_route_cross_connection_peerings_operations_async import ExpressRouteCrossConnectionPeeringsOperations +from ._express_route_ports_locations_operations_async import ExpressRoutePortsLocationsOperations +from ._express_route_ports_operations_async import ExpressRoutePortsOperations +from ._express_route_links_operations_async import ExpressRouteLinksOperations +from ._firewall_policies_operations_async import FirewallPoliciesOperations +from ._firewall_policy_rule_collection_groups_operations_async import FirewallPolicyRuleCollectionGroupsOperations +from ._ip_allocations_operations_async import IpAllocationsOperations +from ._ip_groups_operations_async import IpGroupsOperations +from ._load_balancers_operations_async import LoadBalancersOperations +from ._load_balancer_backend_address_pools_operations_async import LoadBalancerBackendAddressPoolsOperations +from ._load_balancer_frontend_ip_configurations_operations_async import LoadBalancerFrontendIPConfigurationsOperations +from ._inbound_nat_rules_operations_async import InboundNatRulesOperations +from ._load_balancer_load_balancing_rules_operations_async import LoadBalancerLoadBalancingRulesOperations +from ._load_balancer_outbound_rules_operations_async import LoadBalancerOutboundRulesOperations +from ._load_balancer_network_interfaces_operations_async import LoadBalancerNetworkInterfacesOperations +from ._load_balancer_probes_operations_async import LoadBalancerProbesOperations +from ._nat_gateways_operations_async import NatGatewaysOperations +from ._network_interfaces_operations_async import NetworkInterfacesOperations +from ._network_interface_ip_configurations_operations_async import NetworkInterfaceIPConfigurationsOperations +from ._network_interface_load_balancers_operations_async import NetworkInterfaceLoadBalancersOperations +from ._network_interface_tap_configurations_operations_async import NetworkInterfaceTapConfigurationsOperations +from ._network_profiles_operations_async import NetworkProfilesOperations +from ._network_security_groups_operations_async import NetworkSecurityGroupsOperations +from ._security_rules_operations_async import SecurityRulesOperations +from ._default_security_rules_operations_async import DefaultSecurityRulesOperations +from ._network_virtual_appliances_operations_async import NetworkVirtualAppliancesOperations +from ._virtual_appliance_sites_operations_async import VirtualApplianceSitesOperations +from ._virtual_appliance_skus_operations_async import VirtualApplianceSkusOperations +from ._network_watchers_operations_async import NetworkWatchersOperations +from ._packet_captures_operations_async import PacketCapturesOperations +from ._connection_monitors_operations_async import ConnectionMonitorsOperations +from ._flow_logs_operations_async import FlowLogsOperations +from ._operations_async import Operations +from ._private_endpoints_operations_async import PrivateEndpointsOperations +from ._available_private_endpoint_types_operations_async import AvailablePrivateEndpointTypesOperations +from ._private_dns_zone_groups_operations_async import PrivateDnsZoneGroupsOperations +from ._private_link_services_operations_async import PrivateLinkServicesOperations +from ._public_ip_addresses_operations_async import PublicIPAddressesOperations +from ._public_ip_prefixes_operations_async import PublicIPPrefixesOperations +from ._route_filters_operations_async import RouteFiltersOperations +from ._route_filter_rules_operations_async import RouteFilterRulesOperations +from ._route_tables_operations_async import RouteTablesOperations +from ._routes_operations_async import RoutesOperations +from ._security_partner_providers_operations_async import SecurityPartnerProvidersOperations +from ._bgp_service_communities_operations_async import BgpServiceCommunitiesOperations +from ._service_endpoint_policies_operations_async import ServiceEndpointPoliciesOperations +from ._service_endpoint_policy_definitions_operations_async import ServiceEndpointPolicyDefinitionsOperations +from ._service_tags_operations_async import ServiceTagsOperations +from ._usages_operations_async import UsagesOperations +from ._virtual_networks_operations_async import VirtualNetworksOperations +from ._subnets_operations_async import SubnetsOperations +from ._resource_navigation_links_operations_async import ResourceNavigationLinksOperations +from ._service_association_links_operations_async import ServiceAssociationLinksOperations +from ._virtual_network_peerings_operations_async import VirtualNetworkPeeringsOperations +from ._virtual_network_gateways_operations_async import VirtualNetworkGatewaysOperations +from ._virtual_network_gateway_connections_operations_async import VirtualNetworkGatewayConnectionsOperations +from ._local_network_gateways_operations_async import LocalNetworkGatewaysOperations +from ._virtual_network_taps_operations_async import VirtualNetworkTapsOperations +from ._virtual_routers_operations_async import VirtualRoutersOperations +from ._virtual_router_peerings_operations_async import VirtualRouterPeeringsOperations +from ._virtual_wans_operations_async import VirtualWansOperations +from ._vpn_sites_operations_async import VpnSitesOperations +from ._vpn_site_links_operations_async import VpnSiteLinksOperations +from ._vpn_sites_configuration_operations_async import VpnSitesConfigurationOperations +from ._vpn_server_configurations_operations_async import VpnServerConfigurationsOperations +from ._virtual_hubs_operations_async import VirtualHubsOperations +from ._hub_virtual_network_connections_operations_async import HubVirtualNetworkConnectionsOperations +from ._vpn_gateways_operations_async import VpnGatewaysOperations +from ._vpn_connections_operations_async import VpnConnectionsOperations +from ._vpn_site_link_connections_operations_async import VpnSiteLinkConnectionsOperations +from ._vpn_link_connections_operations_async import VpnLinkConnectionsOperations +from ._p2_svpn_gateways_operations_async import P2SVpnGatewaysOperations +from ._vpn_server_configurations_associated_with_virtual_wan_operations_async import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from ._virtual_hub_route_table_v2_s_operations_async import VirtualHubRouteTableV2SOperations +from ._express_route_gateways_operations_async import ExpressRouteGatewaysOperations +from ._express_route_connections_operations_async import ExpressRouteConnectionsOperations +from ._virtual_hub_bgp_connection_operations_async import VirtualHubBgpConnectionOperations +from ._virtual_hub_bgp_connections_operations_async import VirtualHubBgpConnectionsOperations +from ._virtual_hub_ip_configuration_operations_async import VirtualHubIpConfigurationOperations +from ._hub_route_tables_operations_async import HubRouteTablesOperations +from ._web_application_firewall_policies_operations_async import WebApplicationFirewallPoliciesOperations + +__all__ = [ + 'ApplicationGatewaysOperations', + 'ApplicationGatewayPrivateLinkResourcesOperations', + 'ApplicationGatewayPrivateEndpointConnectionsOperations', + 'ApplicationSecurityGroupsOperations', + 'AvailableDelegationsOperations', + 'AvailableResourceGroupDelegationsOperations', + 'AvailableServiceAliasesOperations', + 'AzureFirewallsOperations', + 'AzureFirewallFqdnTagsOperations', + 'BastionHostsOperations', + 'NetworkManagementClientOperationsMixin', + 'DdosCustomPoliciesOperations', + 'DdosProtectionPlansOperations', + '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', + '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_05_01/aio/operations_async/_application_gateway_private_endpoint_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_gateway_private_endpoint_connections_operations_async.py new file mode 100644 index 000000000000..db350d9ecd85 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_gateway_private_endpoint_connections_operations_async.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, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ApplicationGatewayPrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_application_gateway_private_link_resources_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_gateway_private_link_resources_operations_async.py new file mode 100644 index 000000000000..e0a6028181a8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_gateway_private_link_resources_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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_05_01.models.ApplicationGatewayPrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateLinkResourceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_gateways_operations_async.py new file mode 100644 index 000000000000..220498258c5a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_gateways_operations_async.py @@ -0,0 +1,1299 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayAvailableWafRuleSetsResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayAvailableSslOptions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ApplicationGatewaySslPredefinedPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_security_groups_operations_async.py new file mode 100644 index 000000000000..f74c54e6c7e1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_application_security_groups_operations_async.py @@ -0,0 +1,512 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_delegations_operations_async.py new file mode 100644 index 000000000000..fabba7fe648a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_delegations_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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_05_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_endpoint_services_operations_async.py new file mode 100644 index 000000000000..35ef30f431ac --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_endpoint_services_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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_05_01.models.EndpointServicesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_private_endpoint_types_operations_async.py new file mode 100644 index 000000000000..b0eee9974042 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -0,0 +1,182 @@ +# 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 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 + +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_05_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_05_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_resource_group_delegations_operations_async.py new file mode 100644 index 000000000000..ec2a38d6f057 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_resource_group_delegations_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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_05_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_available_service_aliases_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_service_aliases_operations_async.py new file mode 100644 index 000000000000..9780093dcdae --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_available_service_aliases_operations_async.py @@ -0,0 +1,180 @@ +# 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 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 + +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_05_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_05_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py new file mode 100644 index 000000000000..4d3d63b39206 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -0,0 +1,105 @@ +# 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 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 + +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_05_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_05_01.models.AzureFirewallFqdnTagListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_azure_firewalls_operations_async.py new file mode 100644 index 000000000000..ccfb1e7d2701 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -0,0 +1,565 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.AzureFirewall + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_bastion_hosts_operations_async.py new file mode 100644 index 000000000000..be9fe7352f74 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -0,0 +1,447 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.BastionHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_bgp_service_communities_operations_async.py new file mode 100644 index 000000000000..141c49341bcc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -0,0 +1,105 @@ +# 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 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 + +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_05_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_05_01.models.BgpServiceCommunityListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_connection_monitors_operations_async.py new file mode 100644 index 000000000000..bd23785add4e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_connection_monitors_operations_async.py @@ -0,0 +1,803 @@ +# 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 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 + +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_05_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", + **kwargs + ) -> "models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + 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", + **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_05_01.models.ConnectionMonitor + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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_05_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, + 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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ConnectionMonitorListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ddos_custom_policies_operations_async.py new file mode 100644 index 000000000000..9483a9ee01d2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -0,0 +1,380 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ddos_protection_plans_operations_async.py new file mode 100644 index 000000000000..2f50ef544e44 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -0,0 +1,511 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_default_security_rules_operations_async.py new file mode 100644 index 000000000000..e9598fed264c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_default_security_rules_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_05_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_05_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py new file mode 100644 index 000000000000..99dfa63391f7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuitAuthorization + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.AuthorizationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuit_connections_operations_async.py new file mode 100644 index 000000000000..cbb8cbc8d302 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -0,0 +1,427 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py new file mode 100644 index 000000000000..fa6e715ba4c6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuitPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ExpressRouteCircuitPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuits_operations_async.py new file mode 100644 index 000000000000..9c6f63743d60 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -0,0 +1,985 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_connections_operations_async.py new file mode 100644 index 000000000000..dca78a1f9338 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_connections_operations_async.py @@ -0,0 +1,388 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ExpressRouteConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteConnectionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py new file mode 100644 index 000000000000..ab5e5b74c798 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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_05_01.models.ExpressRouteCrossConnectionPeeringList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCrossConnectionPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_cross_connections_operations_async.py new file mode 100644 index 000000000000..bd5526d1c696 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -0,0 +1,771 @@ +# 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 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 + +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_05_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_05_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_gateways_operations_async.py new file mode 100644 index 000000000000..9da6b675a44f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_gateways_operations_async.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, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ExpressRouteGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_links_operations_async.py new file mode 100644 index 000000000000..b5453f4d9dd9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_links_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_05_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_05_01.models.ExpressRouteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ExpressRouteLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_ports_locations_operations_async.py new file mode 100644 index 000000000000..8c9d5c65f67d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -0,0 +1,159 @@ +# 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 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 + +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_05_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_05_01.models.ExpressRoutePortsLocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRoutePortsLocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_ports_operations_async.py new file mode 100644 index 000000000000..39e63a670cc3 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_ports_operations_async.py @@ -0,0 +1,511 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_service_providers_operations_async.py new file mode 100644 index 000000000000..930a1b7e027d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -0,0 +1,105 @@ +# 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 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 + +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_05_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_05_01.models.ExpressRouteServiceProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_firewall_policies_operations_async.py new file mode 100644 index 000000000000..77c4289c2e53 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_firewall_policies_operations_async.py @@ -0,0 +1,452 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.FirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_firewall_policy_rule_collection_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_firewall_policy_rule_collection_groups_operations_async.py new file mode 100644 index 000000000000..a906ec05f374 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_firewall_policy_rule_collection_groups_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.FirewallPolicyRuleCollectionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.FirewallPolicyRuleCollectionGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_flow_logs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_flow_logs_operations_async.py new file mode 100644 index 000000000000..b84477f35310 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_flow_logs_operations_async.py @@ -0,0 +1,408 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 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_05_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.FlowLogListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_hub_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_hub_route_tables_operations_async.py new file mode 100644 index 000000000000..5144bea1fef9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_hub_route_tables_operations_async.py @@ -0,0 +1,404 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.HubRouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListHubRouteTablesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py new file mode 100644 index 000000000000..2e67d7e58909 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.HubVirtualNetworkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ListHubVirtualNetworkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_inbound_nat_rules_operations_async.py new file mode 100644 index 000000000000..a26f5c2dce7d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -0,0 +1,410 @@ +# 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 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 + +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_05_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_05_01.models.InboundNatRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.InboundNatRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01/aio/operations_async/_ip_allocations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ip_allocations_operations_async.py new file mode 100644 index 000000000000..f3c987b48561 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ip_allocations_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_ip_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ip_groups_operations_async.py new file mode 100644 index 000000000000..aa49dae019ed --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_ip_groups_operations_async.py @@ -0,0 +1,523 @@ +# 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 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 + +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_05_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_05_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py new file mode 100644 index 000000000000..4d6009d29e79 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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_05_01.models.LoadBalancerBackendAddressPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.BackendAddressPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py new file mode 100644 index 000000000000..c3c6ce2e8ffd --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_05_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_05_01.models.LoadBalancerFrontendIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.FrontendIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py new file mode 100644 index 000000000000..f14b9ef22793 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_05_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_05_01.models.LoadBalancerLoadBalancingRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.LoadBalancingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py new file mode 100644 index 000000000000..e32aae82a20f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py new file mode 100644 index 000000000000..dbeb1d96c8a7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_05_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_05_01.models.LoadBalancerOutboundRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.OutboundRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_probes_operations_async.py new file mode 100644 index 000000000000..23a46df4b1f4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_05_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_05_01.models.LoadBalancerProbeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.Probe + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancers_operations_async.py new file mode 100644 index 000000000000..6f06b65378cf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_load_balancers_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_local_network_gateways_operations_async.py new file mode 100644 index 000000000000..fae9c12898fc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -0,0 +1,448 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.LocalNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_nat_gateways_operations_async.py new file mode 100644 index 000000000000..1c7af0287f37 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_nat_gateways_operations_async.py @@ -0,0 +1,519 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 + ) -> "models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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) + + 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, {}) + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py new file mode 100644 index 000000000000..1ac9300e1d73 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_05_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_05_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interface_load_balancers_operations_async.py new file mode 100644 index 000000000000..bccf8d6ff73c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interface_load_balancers_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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_05_01.models.NetworkInterfaceLoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py new file mode 100644 index 000000000000..b1845d06a3ca --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkInterfaceTapConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.NetworkInterfaceTapConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interfaces_operations_async.py new file mode 100644 index 000000000000..c4911ef9e898 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_interfaces_operations_async.py @@ -0,0 +1,1101 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_05_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_management_client_operations_async.py new file mode 100644 index 000000000000..c35b00f1e274 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_management_client_operations_async.py @@ -0,0 +1,759 @@ +# 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 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 + +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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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["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_05_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 BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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): + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.BastionShareableLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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["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 either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_05_01.models.BastionActiveSessionListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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): + deserialized = self._deserialize('BastionActiveSessionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.BastionSessionDeleteResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = "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'] = 'application/json' + + 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_05_01.models.DnsNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.VirtualWanSecurityProviders + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_profiles_operations_async.py new file mode 100644 index 000000000000..e62200b1474f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_profiles_operations_async.py @@ -0,0 +1,464 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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_05_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_security_groups_operations_async.py new file mode 100644 index 000000000000..53200803f90d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_security_groups_operations_async.py @@ -0,0 +1,517 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_network_virtual_appliances_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_virtual_appliances_operations_async.py new file mode 100644 index 000000000000..d0725ac0d374 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_virtual_appliances_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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_05_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_watchers_operations_async.py new file mode 100644 index 000000000000..c2576cd9be0b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_network_watchers_operations_async.py @@ -0,0 +1,1870 @@ +# 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 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 + +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_05_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_05_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_05_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_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_05_01.models.Topology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_operations_async.py new file mode 100644 index 000000000000..6a09a38e3281 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_operations_async.py @@ -0,0 +1,101 @@ +# 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 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 + +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_05_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_05_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_p2_svpn_gateways_operations_async.py new file mode 100644 index 000000000000..ae677efad82f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -0,0 +1,969 @@ +# 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 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 + +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_05_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_05_01.models.P2SVpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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( + self, + resource_group_name: str, + gateway_name: str, + p2_s_vpn_gateway_parameters: "models.TagsObject", + **kwargs + ) -> "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_05_01.models.TagsObject + :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_05_01.models.P2SVpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'), + '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'] = 'application/json' + + 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]: + 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 + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 _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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_packet_captures_operations_async.py new file mode 100644 index 000000000000..628ab51e9ac5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_packet_captures_operations_async.py @@ -0,0 +1,625 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.PacketCaptureResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PacketCaptureListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py new file mode 100644 index 000000000000..92a94af9f437 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -0,0 +1,182 @@ +# 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 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 + +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_05_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_05_01.models.PeerExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.PeerExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_private_dns_zone_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_private_dns_zone_groups_operations_async.py new file mode 100644 index 000000000000..107e93340ca5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_private_dns_zone_groups_operations_async.py @@ -0,0 +1,406 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PrivateDnsZoneGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.PrivateDnsZoneGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_private_endpoints_operations_async.py new file mode 100644 index 000000000000..b43d1098e729 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_private_endpoints_operations_async.py @@ -0,0 +1,457 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PrivateEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_private_link_services_operations_async.py new file mode 100644 index 000000000000..06e0fff23afd --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_private_link_services_operations_async.py @@ -0,0 +1,1140 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PrivateLinkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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_05_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_public_ip_addresses_operations_async.py new file mode 100644 index 000000000000..3fcb21ae65a5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -0,0 +1,747 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_public_ip_prefixes_operations_async.py new file mode 100644 index 000000000000..5fcbe4e38bb4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_public_ip_prefixes_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_resource_navigation_links_operations_async.py new file mode 100644 index 000000000000..db9e98e39015 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -0,0 +1,100 @@ +# 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 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 + +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_05_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_05_01.models.ResourceNavigationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_route_filter_rules_operations_async.py new file mode 100644 index 000000000000..23d96f8fb073 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.RouteFilterRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.RouteFilterRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_route_filters_operations_async.py new file mode 100644 index 000000000000..db49b8188541 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_route_filters_operations_async.py @@ -0,0 +1,517 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_route_tables_operations_async.py new file mode 100644 index 000000000000..d56f1ae4f50c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_route_tables_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_routes_operations_async.py new file mode 100644 index 000000000000..9845a158b0d4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_routes_operations_async.py @@ -0,0 +1,404 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.Route + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.RouteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_security_partner_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_security_partner_providers_operations_async.py new file mode 100644 index 000000000000..6dde9fbf8225 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_security_partner_providers_operations_async.py @@ -0,0 +1,512 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_security_rules_operations_async.py new file mode 100644 index 000000000000..d7fbfd75f780 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_security_rules_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_association_links_operations_async.py new file mode 100644 index 000000000000..5415777c67cf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_association_links_operations_async.py @@ -0,0 +1,100 @@ +# 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 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 + +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_05_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_05_01.models.ServiceAssociationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_endpoint_policies_operations_async.py new file mode 100644 index 000000000000..d315ec54d545 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -0,0 +1,517 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py new file mode 100644 index 000000000000..15d2d74d1392 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -0,0 +1,409 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ServiceEndpointPolicyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ServiceEndpointPolicyDefinitionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_tags_operations_async.py new file mode 100644 index 000000000000..2592e1319894 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_service_tags_operations_async.py @@ -0,0 +1,94 @@ +# 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 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 + +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_05_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_05_01.models.ServiceTagsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_subnets_operations_async.py new file mode 100644 index 000000000000..0a559366d275 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_subnets_operations_async.py @@ -0,0 +1,641 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.Subnet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.SubnetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_usages_operations_async.py new file mode 100644 index 000000000000..dc2f12238ba4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_usages_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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_05_01.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_virtual_appliance_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_appliance_sites_operations_async.py new file mode 100644 index 000000000000..8a772cf0ccab --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_appliance_sites_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualApplianceSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.NetworkVirtualApplianceSiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSiteListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_virtual_appliance_skus_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_appliance_skus_operations_async.py new file mode 100644 index 000000000000..f359b3c827f0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_appliance_skus_operations_async.py @@ -0,0 +1,156 @@ +# 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 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 + +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_05_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_05_01.models.NetworkVirtualApplianceSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSkuListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkVirtualApplianceSku + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSku"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_virtual_hub_bgp_connection_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_bgp_connection_operations_async.py new file mode 100644 index 000000000000..63583c9704d2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_bgp_connection_operations_async.py @@ -0,0 +1,333 @@ +# 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 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 + +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_05_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_05_01.models.BgpConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_virtual_hub_bgp_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_bgp_connections_operations_async.py new file mode 100644 index 000000000000..70d366da9598 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_bgp_connections_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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_05_01.models.ListVirtualHubBgpConnectionResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubBgpConnectionResults"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_ip_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_ip_configuration_operations_async.py new file mode 100644 index 000000000000..2dacb2ed6905 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_ip_configuration_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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_05_01.models.HubIpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVirtualHubIpConfigurationResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubIpConfigurationResults"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py new file mode 100644 index 000000000000..61367fb217ae --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py @@ -0,0 +1,409 @@ +# 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 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 + +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_05_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_05_01.models.VirtualHubRouteTableV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVirtualHubRouteTableV2SResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hubs_operations_async.py new file mode 100644 index 000000000000..dc642cf76666 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -0,0 +1,624 @@ +# 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 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 + +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_05_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_05_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py new file mode 100644 index 000000000000..8576478f2ce0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -0,0 +1,1055 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualNetworkGatewayConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ConnectionSharedKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.VirtualNetworkGatewayConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_gateways_operations_async.py new file mode 100644 index 000000000000..3e7d3bdecfab --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -0,0 +1,2278 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.VirtualNetworkGatewayListConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_peerings_operations_async.py new file mode 100644 index 000000000000..d477a101b62a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualNetworkPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualNetworkPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_taps_operations_async.py new file mode 100644 index 000000000000..a20f00a0914e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -0,0 +1,511 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_networks_operations_async.py new file mode 100644 index 000000000000..12f8d79717ea --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_networks_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.IPAddressAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.VirtualNetworkListUsageResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 + + async def get_bastion_hosts( + self, + resource_group_name: str, + virtual_network_name: str, + **kwargs + ) -> "models.BastionHostListResult": + """Get a list of bastion hosts accessible from the given 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: BastionHostListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_05_01.models.BastionHostListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # Construct URL + url = self.get_bastion_hosts.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'] = 'application/json' + + 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('BastionHostListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_bastion_hosts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/bastionHosts'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_router_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_router_peerings_operations_async.py new file mode 100644 index 000000000000..b1d15ec7611f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_router_peerings_operations_async.py @@ -0,0 +1,409 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualRouterPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualRouterPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_virtual_routers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_routers_operations_async.py new file mode 100644 index 000000000000..833d4ee3078d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_routers_operations_async.py @@ -0,0 +1,457 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualRouter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_wans_operations_async.py new file mode 100644 index 000000000000..b8ae325b9bf0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_virtual_wans_operations_async.py @@ -0,0 +1,511 @@ +# 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 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 + +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_05_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_05_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_connections_operations_async.py new file mode 100644 index 000000000000..21598730308b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_connections_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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_05_01.models.VpnConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 + + 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_05_01.models.ListVpnConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_gateways_operations_async.py new file mode 100644 index 000000000000..0f325ea98ba2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_gateways_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_05_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_05_01.models.VpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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( + self, + resource_group_name: str, + gateway_name: str, + vpn_gateway_parameters: "models.TagsObject", + **kwargs + ) -> "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_05_01.models.TagsObject + :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_05_01.models.VpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'), + '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'] = 'application/json' + + 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]: + 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 + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 + + 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_05_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_link_connections_operations_async.py new file mode 100644 index 000000000000..793bae89fbc7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -0,0 +1,118 @@ +# 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 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 + +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_05_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 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: An iterator like instance of either ListVpnSiteLinkConnectionsResult or the result of cls(response) + :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"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py new file mode 100644 index 000000000000..cf49099699df --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py @@ -0,0 +1,151 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_vpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_server_configurations_operations_async.py new file mode 100644 index 000000000000..cf9cb6c00f04 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_server_configurations_operations_async.py @@ -0,0 +1,515 @@ +# 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 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 + +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_05_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_05_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_site_link_connections_operations_async.py new file mode 100644 index 000000000000..1bc72ad9e224 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_site_link_connections_operations_async.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, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.VpnSiteLinkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_site_links_operations_async.py new file mode 100644 index 000000000000..7f12c02581f4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_05_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_05_01.models.VpnSiteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ListVpnSiteLinksResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_sites_configuration_operations_async.py new file mode 100644 index 000000000000..b9a67e06728e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -0,0 +1,153 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_sites_operations_async.py new file mode 100644 index 000000000000..791c9214d703 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_vpn_sites_operations_async.py @@ -0,0 +1,511 @@ +# 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 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 + +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_05_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_05_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_web_application_firewall_policies_operations_async.py new file mode 100644 index 000000000000..8feab9077f29 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -0,0 +1,395 @@ +# 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 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 + +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_05_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_05_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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_05_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/models/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/__init__.py new file mode 100644 index 000000000000..9050f47f2f7a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/__init__.py @@ -0,0 +1,1810 @@ +# 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 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 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 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 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 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 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 FirewallPolicy + from ._models_py3 import FirewallPolicyFilterRuleCollection + from ._models_py3 import FirewallPolicyFilterRuleCollectionAction + 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 FirewallPolicyThreatIntelWhitelist + 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 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 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 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 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 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 VpnDeviceScriptParameters + from ._models_py3 import VpnGateway + 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 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 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 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 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 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 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 FirewallPolicy # type: ignore + from ._models import FirewallPolicyFilterRuleCollection # type: ignore + from ._models import FirewallPolicyFilterRuleCollectionAction # 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 FirewallPolicyThreatIntelWhitelist # 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 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 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 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 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 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 VpnDeviceScriptParameters # type: ignore + from ._models import VpnGateway # 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, + ConnectionMonitorSourceStatus, + ConnectionMonitorTestConfigurationProtocol, + ConnectionMonitorType, + ConnectionState, + ConnectionStatus, + DdosCustomPolicyProtocol, + DdosCustomPolicyTriggerSensitivityOverride, + DdosSettingsProtectionCoverage, + DhGroup, + Direction, + EffectiveRouteSource, + EffectiveRouteState, + EffectiveSecurityRuleProtocol, + EvaluationState, + ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, + ExpressRouteCircuitPeeringState, + ExpressRouteCircuitSkuFamily, + ExpressRouteCircuitSkuTier, + ExpressRouteLinkAdminState, + ExpressRouteLinkConnectorType, + ExpressRouteLinkMacSecCipher, + ExpressRoutePeeringState, + ExpressRoutePeeringType, + ExpressRoutePortsEncapsulation, + FirewallPolicyFilterRuleCollectionActionType, + FirewallPolicyRuleApplicationProtocolType, + FirewallPolicyRuleCollectionType, + FirewallPolicyRuleNetworkProtocol, + FirewallPolicyRuleType, + HTTPConfigurationMethod, + HubBgpConnectionStatus, + HubVirtualNetworkConnectionStatus, + IPAllocationMethod, + IPVersion, + IkeEncryption, + IkeIntegrity, + IpAllocationType, + IpFlowProtocol, + IpsecEncryption, + IpsecIntegrity, + IssueType, + LoadBalancerOutboundRuleProtocol, + LoadBalancerSkuName, + LoadDistribution, + NetworkOperationStatus, + NextHopType, + OfficeTrafficCategory, + Origin, + OwaspCrsExclusionEntryMatchVariable, + OwaspCrsExclusionEntrySelectorMatchOperator, + PcError, + PcProtocol, + PcStatus, + PfsGroup, + PreferredIPVersion, + ProbeProtocol, + ProcessorArchitecture, + Protocol, + ProvisioningState, + PublicIPAddressSkuName, + ResourceIdentityType, + RouteNextHopType, + RoutingState, + SecurityPartnerProviderConnectionStatus, + SecurityProviderName, + SecurityRuleAccess, + SecurityRuleDirection, + SecurityRuleProtocol, + ServiceProviderProvisioningState, + Severity, + TransportProtocol, + TunnelConnectionStatus, + VerbosityLevel, + 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', + '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', + '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', + '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', + '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', + 'DdosCustomPolicy', + 'DdosProtectionPlan', + 'DdosProtectionPlanListResult', + 'DdosSettings', + 'Delegation', + 'DeviceProperties', + 'DhcpOptions', + 'Dimension', + 'DnsNameAvailabilityResult', + 'DnsSettings', + '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', + 'FirewallPolicy', + 'FirewallPolicyFilterRuleCollection', + 'FirewallPolicyFilterRuleCollectionAction', + 'FirewallPolicyListResult', + 'FirewallPolicyNatRuleCollection', + 'FirewallPolicyNatRuleCollectionAction', + 'FirewallPolicyRule', + 'FirewallPolicyRuleApplicationProtocol', + 'FirewallPolicyRuleCollection', + 'FirewallPolicyRuleCollectionGroup', + 'FirewallPolicyRuleCollectionGroupListResult', + 'FirewallPolicyThreatIntelWhitelist', + 'FlowLog', + 'FlowLogFormatParameters', + 'FlowLogInformation', + 'FlowLogListResult', + 'FlowLogStatusParameters', + 'FrontendIPConfiguration', + 'GatewayRoute', + 'GatewayRouteListResult', + 'GetVpnSitesConfigurationRequest', + 'HTTPConfiguration', + 'HTTPHeader', + 'HopLink', + 'HubIPAddresses', + 'HubIpConfiguration', + 'HubPublicIPAddresses', + 'HubRoute', + 'HubRouteTable', + 'HubVirtualNetworkConnection', + 'IPAddressAvailabilityResult', + 'IPConfiguration', + 'IPConfigurationBgpPeeringAddress', + 'IPConfigurationProfile', + 'InboundNatPool', + 'InboundNatRule', + 'InboundNatRuleListResult', + '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', + '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', + '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', + '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', + 'VpnDeviceScriptParameters', + 'VpnGateway', + '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', + 'ConnectionMonitorSourceStatus', + 'ConnectionMonitorTestConfigurationProtocol', + 'ConnectionMonitorType', + 'ConnectionState', + 'ConnectionStatus', + 'DdosCustomPolicyProtocol', + 'DdosCustomPolicyTriggerSensitivityOverride', + 'DdosSettingsProtectionCoverage', + 'DhGroup', + 'Direction', + 'EffectiveRouteSource', + 'EffectiveRouteState', + 'EffectiveSecurityRuleProtocol', + 'EvaluationState', + 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixState', + 'ExpressRouteCircuitPeeringState', + 'ExpressRouteCircuitSkuFamily', + 'ExpressRouteCircuitSkuTier', + 'ExpressRouteLinkAdminState', + 'ExpressRouteLinkConnectorType', + 'ExpressRouteLinkMacSecCipher', + 'ExpressRoutePeeringState', + 'ExpressRoutePeeringType', + 'ExpressRoutePortsEncapsulation', + 'FirewallPolicyFilterRuleCollectionActionType', + 'FirewallPolicyRuleApplicationProtocolType', + 'FirewallPolicyRuleCollectionType', + 'FirewallPolicyRuleNetworkProtocol', + 'FirewallPolicyRuleType', + 'HTTPConfigurationMethod', + 'HubBgpConnectionStatus', + 'HubVirtualNetworkConnectionStatus', + 'IPAllocationMethod', + 'IPVersion', + 'IkeEncryption', + 'IkeIntegrity', + 'IpAllocationType', + 'IpFlowProtocol', + 'IpsecEncryption', + 'IpsecIntegrity', + 'IssueType', + 'LoadBalancerOutboundRuleProtocol', + 'LoadBalancerSkuName', + 'LoadDistribution', + 'NetworkOperationStatus', + 'NextHopType', + 'OfficeTrafficCategory', + 'Origin', + 'OwaspCrsExclusionEntryMatchVariable', + 'OwaspCrsExclusionEntrySelectorMatchOperator', + 'PcError', + 'PcProtocol', + 'PcStatus', + 'PfsGroup', + 'PreferredIPVersion', + 'ProbeProtocol', + 'ProcessorArchitecture', + 'Protocol', + 'ProvisioningState', + 'PublicIPAddressSkuName', + 'ResourceIdentityType', + 'RouteNextHopType', + 'RoutingState', + 'SecurityPartnerProviderConnectionStatus', + 'SecurityProviderName', + 'SecurityRuleAccess', + 'SecurityRuleDirection', + 'SecurityRuleProtocol', + 'ServiceProviderProvisioningState', + 'Severity', + 'TransportProtocol', + 'TunnelConnectionStatus', + 'VerbosityLevel', + '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_05_01/models/_models.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_models.py new file mode 100644 index 000000000000..97cc5fd37358 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_models.py @@ -0,0 +1,21199 @@ +# 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_05_01.models.ManagedServiceIdentity + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.ApplicationGatewayTrustedRootCertificate] + :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_05_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_05_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_05_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.ApplicationGatewayHttpListener] + :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_05_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayRequestRoutingRule] + :param rewrite_rule_sets: Rewrite rules for the application gateway resource. + :type rewrite_rule_sets: + list[~azure.mgmt.network.v2020_05_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_05_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_05_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_05_01.models.ApplicationGatewayAutoscaleConfiguration + :param private_link_configurations: PrivateLink configurations on application gateway. + :type private_link_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayPrivateLinkConfiguration] + :ivar private_endpoint_connections: Private Endpoint connections on application gateway. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the application gateway + resource. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_05_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]'}, + '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]'}, + '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.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.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_05_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_05_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_05_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses. + :type backend_addresses: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2020_05_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_05_01.models.ApplicationGatewayBackendAddressPool + :param backend_health_http_settings: Application gateway BackendHealthHttp settings. + :type backend_health_http_settings: + ~azure.mgmt.network.v2020_05_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_05_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings + resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param authentication_certificates: Array of references to application gateway authentication + certificates. + :type authentication_certificates: list[~azure.mgmt.network.v2020_05_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_05_01.models.SubResource] + :param connection_draining: Connection draining of the backend http settings resource. + :type connection_draining: + ~azure.mgmt.network.v2020_05_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_05_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 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_05_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_05_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_05_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_05_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_05_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param public_ip_address: Reference to the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param private_link_configuration: Reference to the application gateway private link + configuration. + :type private_link_configuration: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param protocol: Protocol of the HTTP listener. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the HTTP listener. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayCustomError] + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_05_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'}, + '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.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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path map path rule. + :type redirect_configuration: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ProvisioningState + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request to. + :type target_listener: ~azure.mgmt.network.v2020_05_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_05_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect configuration. + :type url_path_maps: list[~azure.mgmt.network.v2020_05_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.SubResource + :param backend_http_settings: Backend http settings resource of the application gateway. + :type backend_http_settings: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2020_05_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_05_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the application gateway. + :type redirect_configuration: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.ApplicationGatewayHeaderConfiguration] + :param response_header_configurations: Response Header Actions in the Action Set. + :type response_header_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayHeaderConfiguration] + :param url_configuration: Url Configuration Action in the Action Set. + :type url_configuration: + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: "Predefined", "Custom". + :type policy_type: str or + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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 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_05_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_05_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_05_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_05_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration resource of URL path map. + :type default_redirect_configuration: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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 + + +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_05_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_05_01.models.FirewallPolicyRuleApplicationProtocol] + :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] + """ + + _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]'}, + 'fqdn_tags': {'key': 'fqdnTags', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationRule, self).__init__(**kwargs) + self.rule_type = 'ApplicationRule' + 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.fqdn_tags = kwargs.get('fqdn_tags', None) + self.source_ip_groups = kwargs.get('source_ip_groups', 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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.NetworkOperationStatus + :param error: Details of the error occurred during specified asynchronous operation. + :type error: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.AzureFirewallNetworkRuleCollection] + :param ip_configurations: IP configuration of the Azure Firewall resource. + :type ip_configurations: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.AzureFirewallThreatIntelMode + :param virtual_hub: The virtualHub to which the firewall belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param firewall_policy: The firewallPolicy associated with this azure firewall. + :type firewall_policy: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param hub_ip_addresses: IP addresses associated with AzureFirewall. + :type hub_ip_addresses: ~azure.mgmt.network.v2020_05_01.models.HubIPAddresses + :ivar ip_groups: IpGroups associated with AzureFirewall. + :vartype ip_groups: list[~azure.mgmt.network.v2020_05_01.models.AzureFirewallIpGroups] + :param sku: The Azure Firewall Resource SKU. + :type sku: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a application rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.AzureFirewallNatRCAction + :param rules: Collection of rules used by a NAT rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a network rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.AzureFirewallSkuName + :param tier: Tier of an Azure Firewall. Possible values include: "Standard", "Premium". + :type tier: str or ~azure.mgmt.network.v2020_05_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_05_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report items. + :type reachability_report: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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 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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _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 + """ + + _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 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_05_01.models.ConnectionMonitorEndpointFilter + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'ConnectionMonitorEndpointFilter'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpoint, self).__init__(**kwargs) + self.name = kwargs['name'] + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.filter = kwargs.get('filter', None) + + +class ConnectionMonitorEndpointFilter(msrest.serialization.Model): + """Describes the connection monitor endpoint filter. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The behavior of the endpoint filter. Currently only 'Include' is supported. Default + value: "Include". + :vartype type: str + :param items: List of items in the filter. + :type items: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorEndpointFilterItem] + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'items': {'key': 'items', 'type': '[ConnectionMonitorEndpointFilterItem]'}, + } + + type = "Include" + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpointFilter, self).__init__(**kwargs) + self.items = kwargs.get('items', None) + + +class ConnectionMonitorEndpointFilterItem(msrest.serialization.Model): + """Describes the connection monitor endpoint filter item. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of item included in the filter. Currently only 'AgentAddress' is + supported. Default value: "AgentAddress". + :vartype type: str + :param address: The address of the filter item. + :type address: str + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + } + + type = "AgentAddress" + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpointFilterItem, 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_05_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_05_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 + """ + + _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_05_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Connection monitor output destination type. Currently, only "Workspace" is + supported. Default value: "Workspace". + :vartype type: str + :param workspace_settings: Describes the settings for producing output into a log analytics + workspace. + :type workspace_settings: + ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorWorkspaceSettings + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_settings': {'key': 'workspaceSettings', 'type': 'ConnectionMonitorWorkspaceSettings'}, + } + + type = "Workspace" + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorOutput, self).__init__(**kwargs) + 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_05_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _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_05_01.models.ConnectionMonitorSourceStatus + :param states: Information about connection states. + :type states: list[~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ConnectionMonitorType + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + '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_05_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ConnectionMonitorType + """ + + _validation = { + '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}, + } + + _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 + """ + + _attribute_map = { + 'port': {'key': 'port', 'type': 'int'}, + 'disable_trace_route': {'key': 'disableTraceRoute', 'type': 'bool'}, + } + + 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) + + +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_05_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_05_01.models.PreferredIPVersion + :param http_configuration: The parameters used to perform test evaluation over HTTP. + :type http_configuration: + ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorHttpConfiguration + :param tcp_configuration: The parameters used to perform test evaluation over TCP. + :type tcp_configuration: + ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTcpConfiguration + :param icmp_configuration: The parameters used to perform test evaluation over ICMP. + :type icmp_configuration: + ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorIcmpConfiguration + :param success_threshold: The threshold for declaring a test successful. + :type success_threshold: + ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.EvaluationState + :param avg_latency_in_ms: Average latency in ms. + :type avg_latency_in_ms: int + :param min_latency_in_ms: Minimum latency in ms. + :type min_latency_in_ms: int + :param max_latency_in_ms: Maximum latency in ms. + :type max_latency_in_ms: int + :param probes_sent: The number of sent probes. + :type probes_sent: int + :param probes_failed: The number of failed probes. + :type probes_failed: int + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2020_05_01.models.ConnectivityHop] + """ + + _validation = { + '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': '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'}, + '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 + """ + + _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_05_01.models.HopLink] + :ivar previous_links: List of previous hop links. + :vartype previous_links: list[~azure.mgmt.network.v2020_05_01.models.HopLink] + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: "Error", "Warning". + :vartype severity: str or ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ConnectivitySource + :param destination: Required. The destination of connection. + :type destination: ~azure.mgmt.network.v2020_05_01.models.ConnectivityDestination + :param protocol: Network protocol. Possible values include: "Tcp", "Http", "Https", "Icmp". + :type protocol: str or ~azure.mgmt.network.v2020_05_01.models.Protocol + :param protocol_configuration: Configuration of the protocol. + :type protocol_configuration: ~azure.mgmt.network.v2020_05_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_05_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}, + } + + _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_05_01.models.ContainerNetworkInterfaceConfiguration + :param container: Reference to the container to which this container network interface is + attached. + :type container: ~azure.mgmt.network.v2020_05_01.models.SubResource + :ivar ip_configurations: Reference to the ip configuration on this container nic. + :vartype ip_configurations: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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 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_05_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_05_01.models.SubResource] + :param protocol_custom_settings: The protocol-specific DDoS policy customization parameters. + :type protocol_custom_settings: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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 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_05_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2020_05_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_05_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_05_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values include: "Active", "Invalid". + :type state: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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: ~azure.mgmt.network.v2020_05_01.models.Resource + :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'}, + '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_05_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_05_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_05_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_05_01.models.MatchedRule + :ivar rules_evaluation_result: List of network security rules evaluation results. + :vartype rules_evaluation_result: + list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_05_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_05_01.models.ExpressRouteCircuitPeeringConfig + :param stats: The peering stats of express route circuit. + :type stats: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.SubResource + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2020_05_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param express_route_connection: The ExpressRoute connection. + :type express_route_connection: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values include: "UnlimitedData", "MeteredData". + :type family: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.ProvisioningState + :param express_route_circuit_peering: The ExpressRoute circuit peering. + :type express_route_circuit_peering: + ~azure.mgmt.network.v2020_05_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 routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_05_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'}, + '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.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_05_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 + :param peering_location: The peering location of the ExpressRoute circuit. + :type peering_location: str + :param bandwidth_in_mbps: The circuit bandwidth In Mbps. + :type bandwidth_in_mbps: int + :param express_route_circuit: The ExpressRouteCircuit. + :type express_route_circuit: + ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ProvisioningState + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_05_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}, + '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 = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('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_05_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_05_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration + :ivar express_route_connections: List of ExpressRoute connections to the ExpressRoute gateway. + :vartype express_route_connections: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ProvisioningState + :param mac_sec_config: MacSec configuration. + :type mac_sec_config: ~azure.mgmt.network.v2020_05_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_05_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: "gcm-aes-128", "gcm-aes-256". + :type cipher: str or ~azure.mgmt.network.v2020_05_01.models.ExpressRouteLinkMacSecCipher + """ + + _attribute_map = { + 'ckn_secret_identifier': {'key': 'cknSecretIdentifier', 'type': 'str'}, + 'cak_secret_identifier': {'key': 'cakSecretIdentifier', 'type': 'str'}, + 'cipher': {'key': 'cipher', '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) + + +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_05_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_05_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_05_01.models.ExpressRouteLink] + :ivar circuits: Reference the ExpressRoute circuit(s) that are provisioned on this + ExpressRoutePort resource. + :vartype circuits: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 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 + :ivar rule_collection_groups: List of references to FirewallPolicyRuleCollectionGroups. + :vartype rule_collection_groups: list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + :param base_policy: The parent firewall policy from which rules are inherited. + :type base_policy: ~azure.mgmt.network.v2020_05_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_05_01.models.SubResource] + :ivar child_policies: List of references to Child Firewall Policies. + :vartype child_policies: list[~azure.mgmt.network.v2020_05_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_05_01.models.AzureFirewallThreatIntelMode + :param threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. + :type threat_intel_whitelist: + ~azure.mgmt.network.v2020_05_01.models.FirewallPolicyThreatIntelWhitelist + :param dns_settings: DNS Proxy Settings definition. + :type dns_settings: ~azure.mgmt.network.v2020_05_01.models.DnsSettings + """ + + _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'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicy, self).__init__(**kwargs) + self.etag = 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) + + +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_05_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 + 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_05_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_05_01.models.FirewallPolicyFilterRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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' + 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_05_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 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_05_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_05_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_05_01.models.FirewallPolicyNatRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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' + self.action = kwargs.get('action', None) + self.rules = kwargs.get('rules', None) + + +class FirewallPolicyNatRuleCollectionAction(msrest.serialization.Model): + """Properties of the FirewallPolicyNatRuleCollectionAction. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of action. Default value: "DNAT". + :vartype type: str + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "DNAT" + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyNatRuleCollectionAction, self).__init__(**kwargs) + + +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_05_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_05_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_05_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_05_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 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 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_05_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_05_01.models.FlowLogFormatParameters + :param flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :type flow_analytics_configuration: + ~azure.mgmt.network.v2020_05_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_05_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The file type of flow log. Default value: "JSON". + :vartype type: str + :param version: The version (revision) of the flow log. + :type version: int + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + } + + type = "JSON" + + def __init__( + self, + **kwargs + ): + super(FlowLogFormatParameters, self).__init__(**kwargs) + 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_05_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_05_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.IPVersion + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.Subnet + :param public_ip_address: The reference to the Public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_01.models.PublicIPAddress + :param public_ip_prefix: The reference to the Public IP Prefix resource. + :type public_ip_prefix: ~azure.mgmt.network.v2020_05_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_05_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_05_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 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_05_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: int + :ivar round_trip_time_avg: Average roundtrip time in milliseconds. + :vartype round_trip_time_avg: int + :ivar round_trip_time_max: Maximum roundtrip time in milliseconds. + :vartype round_trip_time_max: int + """ + + _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}, + 'round_trip_time_avg': {'readonly': True}, + 'round_trip_time_max': {'readonly': True}, + } + + _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': 'int'}, + 'round_trip_time_avg': {'key': 'properties.roundTripTimeAvg', 'type': 'int'}, + 'round_trip_time_max': {'key': 'properties.roundTripTimeMax', 'type': 'int'}, + } + + 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar method: HTTP method. Default value: "Get". + :vartype method: str + :param headers: List of HTTP headers. + :type headers: list[~azure.mgmt.network.v2020_05_01.models.HTTPHeader] + :param valid_status_codes: Valid status codes. + :type valid_status_codes: list[int] + """ + + _validation = { + 'method': {'constant': True}, + } + + _attribute_map = { + 'method': {'key': 'method', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '[HTTPHeader]'}, + 'valid_status_codes': {'key': 'validStatusCodes', 'type': '[int]'}, + } + + method = "Get" + + def __init__( + self, + **kwargs + ): + super(HTTPConfiguration, self).__init__(**kwargs) + 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_05_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_05_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 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_05_01.models.SubResource + :ivar virtual_network: The VirtualNetwork that using the prefix of this IpAllocation resource. + :vartype virtual_network: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.ProvisioningState + :param ip_addresses: IpAddresses/IpAddressPrefixes in the IpGroups resource. + :type ip_addresses: list[str] + :ivar firewalls: List of references to Azure resources that this IpGroups is associated with. + :vartype firewalls: list[~azure.mgmt.network.v2020_05_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'firewalls': {'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]'}, + } + + 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 + + +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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference to the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param state: The state of peering. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer. + :type probes: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.InboundNatPool] + :param outbound_rules: The outbound rules. + :type outbound_rules: list[~azure.mgmt.network.v2020_05_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_05_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}'}, + '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.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_05_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_05_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'}, + } + + 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 + + +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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = kwargs.get('name', 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_05_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_05_01.models.SubResource + :param probe: The reference to the load balancer probe used by the load balancing rule. + :type probe: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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. + + 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 rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :ivar state: The state of the managed rule. Defaults to Disabled if not specified. Default + value: "Disabled". + :vartype state: str + """ + + _validation = { + 'rule_id': {'required': True}, + 'state': {'constant': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + state = "Disabled" + + def __init__( + self, + **kwargs + ): + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = kwargs['rule_id'] + + +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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource] + :ivar subnets: An array of references to the subnets using this nat gateway resource. + :vartype subnets: list[~azure.mgmt.network.v2020_05_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_05_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_05_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of Nat Gateway SKU. Default value: "Standard". + :vartype name: str + """ + + _validation = { + 'name': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "Standard" + + def __init__( + self, + **kwargs + ): + super(NatGatewaySku, self).__init__(**kwargs) + + +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_05_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_05_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] + """ + + _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]'}, + } + + def __init__( + self, + **kwargs + ): + super(NatRule, self).__init__(**kwargs) + self.rule_type = 'NatRule' + 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) + + +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_05_01.models.VerbosityLevel + :param profiles: Required. List of network configuration diagnostic profiles. + :type profiles: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.NetworkConfigurationDiagnosticProfile + :param network_security_group_result: Network security group result. + :type network_security_group_result: + ~azure.mgmt.network.v2020_05_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_05_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] + :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_05_01.models.SubResource + :param network_security_group: The reference to the NetworkSecurityGroup resource. + :type network_security_group: ~azure.mgmt.network.v2020_05_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_05_01.models.PrivateEndpoint + :param ip_configurations: A list of IPConfigurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfiguration] + :ivar tap_configurations: A list of TapConfigurations of the network interface. + :vartype tap_configurations: + list[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceTapConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: ~azure.mgmt.network.v2020_05_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 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_05_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}, + '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'}, + '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]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterface, self).__init__(**kwargs) + 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.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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.ProvisioningState + :ivar private_link_connection_properties: PrivateLinkConnection properties for the network + interface. + :vartype private_link_connection_properties: + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_05_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' + 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_05_01.models.SecurityRule] + :ivar default_security_rules: The default security rules of network security group. + :vartype default_security_rules: list[~azure.mgmt.network.v2020_05_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network interfaces. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_05_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_05_01.models.Subnet] + :ivar flow_logs: A collection of references to flow log resources. + :vartype flow_logs: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.VirtualApplianceSkuProperties + :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_05_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_05_01.models.VirtualApplianceNicProperties] + :ivar virtual_appliance_sites: List of references to VirtualApplianceSite. + :vartype virtual_appliance_sites: list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_appliance_asn': {'maximum': 4294967295, 'minimum': 0}, + 'virtual_appliance_nics': {'readonly': True}, + 'virtual_appliance_sites': {'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'}, + '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]'}, + '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.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.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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 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_05_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_05_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_05_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_05_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_05_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.RoutingConfiguration + :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_05_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'}, + '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.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_05_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_05_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_05_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_05_01.models.SubResource + :ivar vpn_client_connection_health: All P2S VPN clients' connection health status. + :vartype vpn_client_connection_health: + ~azure.mgmt.network.v2020_05_01.models.VpnClientConnectionHealth + :param custom_dns_servers: List of all customer specified DNS servers IP addresses. + :type custom_dns_servers: list[str] + """ + + _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]'}, + } + + 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) + + +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_05_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_05_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_05_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + '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_05_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_05_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_05_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_05_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + '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_05_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_05_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_05_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + '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': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + '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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_05_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + '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_05_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. Default value: "Community". + :vartype route_filter_rule_type: str + :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_05_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'route_filter_rule_type': {'constant': 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'}, + } + + route_filter_rule_type = "Community" + + def __init__( + self, + **kwargs + ): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.name = None + self.etag = None + self.access = kwargs.get('access', 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_05_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_05_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_05_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_05_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_05_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 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_05_01.models.WebApplicationFirewallEnabledState + :param mode: The mode of the policy. Possible values include: "Prevention", "Detection". + :type mode: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.PrivateLinkServiceConnection] + :param custom_dns_configs: An array of custom dns configurations. + :type custom_dns_configs: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.FrontendIPConfiguration] + :param ip_configurations: An array of private link service IP configurations. + :type ip_configurations: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.PrivateEndpointConnection] + :param visibility: The visibility list of the private link service. + :type visibility: ~azure.mgmt.network.v2020_05_01.models.ResourceSet + :param auto_approval: The auto-approval list of the private link service. + :type auto_approval: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP address. + :vartype ip_configuration: ~azure.mgmt.network.v2020_05_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_05_01.models.PublicIPAddressDnsSettings + :param ddos_settings: The DDoS protection custom policy associated with the public IP address. + :type ddos_settings: ~azure.mgmt.network.v2020_05_01.models.DdosSettings + :param ip_tags: The list of tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.network.v2020_05_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_05_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_05_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}'}, + '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.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_05_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_05_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = kwargs.get('name', 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 sku: The public IP prefix SKU. + :type sku: ~azure.mgmt.network.v2020_05_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_05_01.models.IPVersion + :param ip_tags: The list of tags associated with the public IP prefix. + :type ip_tags: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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}'}, + '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'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPPrefix, self).__init__(**kwargs) + 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.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_05_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of a public IP prefix SKU. Default value: "Standard". + :vartype name: str + """ + + _validation = { + 'name': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "Standard" + + def __init__( + self, + **kwargs + ): + super(PublicIPPrefixSku, self).__init__(**kwargs) + + +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_05_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_05_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_05_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_05_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_05_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_05_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. Default value: "Community". + :vartype route_filter_rule_type: str + :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_05_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'route_filter_rule_type': {'constant': 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'}, + } + + route_filter_rule_type = "Community" + + 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.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_05_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_05_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_05_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.SubResource + :param propagated_route_tables: The list of RouteTables to advertise the routes to. + :type propagated_route_tables: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SecurityPartnerProviderConnectionStatus + :param virtual_hub: The virtualHub to which the Security Partner Provider belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.NetworkInterfaceAssociation + :param subnet_association: Subnet and it's custom security rules. + :type subnet_association: ~azure.mgmt.network.v2020_05_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_05_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.ServiceEndpointPolicyDefinition] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ServiceTagInformation] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'change_number': {'readonly': True}, + 'cloud': {'readonly': True}, + 'values': {'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]'}, + } + + 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 + + +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_05_01.models.NetworkSecurityGroup + :param route_table: The reference to the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2020_05_01.models.RouteTable + :param nat_gateway: Nat gateway associated with this subnet. + :type nat_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPropertiesFormat] + :param service_endpoint_policies: An array of service endpoint policies. + :type service_endpoint_policies: + list[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicy] + :ivar private_endpoints: An array of references to private endpoints. + :vartype private_endpoints: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.IPConfigurationProfile] + :param ip_allocations: Array of IpAllocation which reference this subnet. + :type ip_allocations: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ServiceAssociationLink] + :param delegations: An array of references to the delegations on the subnet. + :type delegations: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param target_subnet: The reference to the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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 + :ivar unit: Required. An enum describing the unit of measurement. Default value: "Count". + :vartype unit: str + :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_05_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': 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'}, + } + + unit = "Count" + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = None + 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_05_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_05_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values include: "TCP", "UDP". + :type protocol: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param vpn_gateway: The VpnGateway associated with this VirtualHub. + :type vpn_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param p2_s_vpn_gateway: The P2SVpnGateway associated with this VirtualHub. + :type p2_s_vpn_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param express_route_gateway: The expressRouteGateway associated with this VirtualHub. + :type express_route_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param azure_firewall: The azureFirewall associated with this VirtualHub. + :type azure_firewall: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param security_partner_provider: The securityPartnerProvider associated with this VirtualHub. + :type security_partner_provider: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.RoutingState + :ivar bgp_connections: List of references to Bgp Connections. + :vartype bgp_connections: list[~azure.mgmt.network.v2020_05_01.models.SubResource] + :ivar ip_configurations: List of references to IpConfigurations. + :vartype ip_configurations: list[~azure.mgmt.network.v2020_05_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] + """ + + _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]'}, + } + + 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) + + +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_05_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_05_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_05_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_05_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] + :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_05_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_05_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2020_05_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.VirtualNetworkBgpCommunities + :param ip_allocations: Array of IpAllocation which reference this VNET. + :type ip_allocations: list[~azure.mgmt.network.v2020_05_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}'}, + '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.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_05_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible values include: "Vpn", + "ExpressRoute". + :type gateway_type: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_05_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_05_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_05_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 + """ + + _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'}, + } + + 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 + + +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_05_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: ~azure.mgmt.network.v2020_05_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_05_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_05_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 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_05_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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'}, + '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.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_05_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.VirtualNetworkGatewayConnectionProtocol + :param routing_weight: The routing weight. + :type routing_weight: int + :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_05_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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'}, + '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.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_05_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_05_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param remote_address_space: The reference to the remote virtual network address space. + :type remote_address_space: ~azure.mgmt.network.v2020_05_01.models.AddressSpace + :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_05_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_05_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'}, + '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.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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param hosted_gateway: The Gateway on which VirtualRouter is hosted. + :type hosted_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :ivar peerings: List of references to VirtualRouterPeerings. + :vartype peerings: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource] + :ivar vpn_sites: List of VpnSites in the VirtualWAN. + :vartype vpn_sites: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network + gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ProcessorArchitecture + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.SubResource + :param routing_weight: Routing weight for vpn connection. + :type routing_weight: int + :param dpd_timeout_seconds: The dead peer detection timeout for a vpn connection in seconds. + :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_05_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_05_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_05_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_05_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_05_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_05_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 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_05_01.models.SubResource + :param connections: List of all vpn connections to the gateway. + :type connections: list[~azure.mgmt.network.v2020_05_01.models.VpnConnection] + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + :param vpn_gateway_scale_unit: The scale unit for this vpn gateway. + :type vpn_gateway_scale_unit: int + """ + + _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_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'}, + } + + 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) + + +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_05_01.models.VpnGatewayTunnelingProtocol] + :param vpn_authentication_types: VPN authentication types for the VpnServerConfiguration. + :type vpn_authentication_types: list[str or + ~azure.mgmt.network.v2020_05_01.models.VpnAuthenticationType] + :param vpn_client_root_certificates: VPN client root certificate of VpnServerConfiguration. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnServerConfigVpnClientRootCertificate] + :param vpn_client_revoked_certificates: VPN client revoked certificate of + VpnServerConfiguration. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnServerConfigVpnClientRevokedCertificate] + :param radius_server_root_certificates: Radius Server root certificate of + VpnServerConfiguration. + :type radius_server_root_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnServerConfigRadiusServerRootCertificate] + :param radius_client_root_certificates: Radius client root certificate of + VpnServerConfiguration. + :type radius_client_root_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnServerConfigRadiusClientRootCertificate] + :param vpn_client_ipsec_policies: VpnClientIpsecPolicies for VpnServerConfiguration. + :type vpn_client_ipsec_policies: list[~azure.mgmt.network.v2020_05_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_05_01.models.RadiusServer] + :param aad_authentication_parameters: The set of aad vpn authentication parameters. + :type aad_authentication_parameters: + ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.SubResource + :param device_properties: The device properties. + :type device_properties: ~azure.mgmt.network.v2020_05_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_05_01.models.AddressSpace + :param bgp_properties: The set of bgp properties. + :type bgp_properties: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.VpnSiteLink] + """ + + _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]'}, + } + + 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) + + +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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.WebApplicationFirewallRuleType + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.network.v2020_05_01.models.MatchCondition] + :param action: Required. Type of Actions. Possible values include: "Allow", "Block", "Log". + :type action: str or ~azure.mgmt.network.v2020_05_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_05_01.models.PolicySettings + :param custom_rules: The custom rules inside the policy. + :type custom_rules: + list[~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallCustomRule] + :ivar application_gateways: A collection of references to application gateways. + :vartype application_gateways: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.WebApplicationFirewallPolicyResourceState + :param managed_rules: Describes the managedRules structure. + :type managed_rules: ~azure.mgmt.network.v2020_05_01.models.ManagedRulesDefinition + :ivar http_listeners: A collection of references to application gateway http listeners. + :vartype http_listeners: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01/models/_models_py3.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_models_py3.py new file mode 100644 index 000000000000..7d3bcb79a5d5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_models_py3.py @@ -0,0 +1,23548 @@ +# 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_05_01.models.ManagedServiceIdentity + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.ApplicationGatewayTrustedRootCertificate] + :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_05_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_05_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_05_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.ApplicationGatewayHttpListener] + :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_05_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayRequestRoutingRule] + :param rewrite_rule_sets: Rewrite rules for the application gateway resource. + :type rewrite_rule_sets: + list[~azure.mgmt.network.v2020_05_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_05_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_05_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_05_01.models.ApplicationGatewayAutoscaleConfiguration + :param private_link_configurations: PrivateLink configurations on application gateway. + :type private_link_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayPrivateLinkConfiguration] + :ivar private_endpoint_connections: Private Endpoint connections on application gateway. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the application gateway + resource. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_05_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]'}, + '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]'}, + '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, + 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, + 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.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.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_05_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_05_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_05_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2020_05_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses. + :type backend_addresses: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2020_05_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_05_01.models.ApplicationGatewayBackendAddressPool + :param backend_health_http_settings: Application gateway BackendHealthHttp settings. + :type backend_health_http_settings: + ~azure.mgmt.network.v2020_05_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_05_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings + resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param authentication_certificates: Array of references to application gateway authentication + certificates. + :type authentication_certificates: list[~azure.mgmt.network.v2020_05_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_05_01.models.SubResource] + :param connection_draining: Connection draining of the backend http settings resource. + :type connection_draining: + ~azure.mgmt.network.v2020_05_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_05_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 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_05_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_05_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_05_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_05_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_05_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param public_ip_address: Reference to the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param private_link_configuration: Reference to the application gateway private link + configuration. + :type private_link_configuration: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param protocol: Protocol of the HTTP listener. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the HTTP listener. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayCustomError] + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_05_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'}, + '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, + 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.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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path map path rule. + :type redirect_configuration: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ProvisioningState + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request to. + :type target_listener: ~azure.mgmt.network.v2020_05_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_05_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect configuration. + :type url_path_maps: list[~azure.mgmt.network.v2020_05_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.SubResource + :param backend_http_settings: Backend http settings resource of the application gateway. + :type backend_http_settings: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2020_05_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_05_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the application gateway. + :type redirect_configuration: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.ApplicationGatewayHeaderConfiguration] + :param response_header_configurations: Response Header Actions in the Action Set. + :type response_header_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayHeaderConfiguration] + :param url_configuration: Url Configuration Action in the Action Set. + :type url_configuration: + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: "Predefined", "Custom". + :type policy_type: str or + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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 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_05_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_05_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_05_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_05_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration resource of URL path map. + :type default_redirect_configuration: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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: Optional[str] = None + + +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_05_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_05_01.models.FirewallPolicyRuleApplicationProtocol] + :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] + """ + + _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]'}, + '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, + destination_addresses: Optional[List[str]] = None, + protocols: Optional[List["FirewallPolicyRuleApplicationProtocol"]] = None, + target_fqdns: Optional[List[str]] = None, + fqdn_tags: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + **kwargs + ): + super(ApplicationRule, self).__init__(name=name, description=description, **kwargs) + self.rule_type: str = 'ApplicationRule' + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.protocols = protocols + self.target_fqdns = target_fqdns + self.fqdn_tags = fqdn_tags + self.source_ip_groups = source_ip_groups + + +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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.NetworkOperationStatus + :param error: Details of the error occurred during specified asynchronous operation. + :type error: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.AzureFirewallNetworkRuleCollection] + :param ip_configurations: IP configuration of the Azure Firewall resource. + :type ip_configurations: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.AzureFirewallThreatIntelMode + :param virtual_hub: The virtualHub to which the firewall belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param firewall_policy: The firewallPolicy associated with this azure firewall. + :type firewall_policy: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param hub_ip_addresses: IP addresses associated with AzureFirewall. + :type hub_ip_addresses: ~azure.mgmt.network.v2020_05_01.models.HubIPAddresses + :ivar ip_groups: IpGroups associated with AzureFirewall. + :vartype ip_groups: list[~azure.mgmt.network.v2020_05_01.models.AzureFirewallIpGroups] + :param sku: The Azure Firewall Resource SKU. + :type sku: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a application rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.AzureFirewallNatRCAction + :param rules: Collection of rules used by a NAT rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a network rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.AzureFirewallSkuName + :param tier: Tier of an Azure Firewall. Possible values include: "Standard", "Premium". + :type tier: str or ~azure.mgmt.network.v2020_05_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_05_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report items. + :type reachability_report: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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 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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _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 + """ + + _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 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_05_01.models.ConnectionMonitorEndpointFilter + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'ConnectionMonitorEndpointFilter'}, + } + + def __init__( + self, + *, + name: str, + resource_id: Optional[str] = None, + address: Optional[str] = None, + filter: Optional["ConnectionMonitorEndpointFilter"] = None, + **kwargs + ): + super(ConnectionMonitorEndpoint, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.address = address + self.filter = filter + + +class ConnectionMonitorEndpointFilter(msrest.serialization.Model): + """Describes the connection monitor endpoint filter. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The behavior of the endpoint filter. Currently only 'Include' is supported. Default + value: "Include". + :vartype type: str + :param items: List of items in the filter. + :type items: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorEndpointFilterItem] + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'items': {'key': 'items', 'type': '[ConnectionMonitorEndpointFilterItem]'}, + } + + type = "Include" + + def __init__( + self, + *, + items: Optional[List["ConnectionMonitorEndpointFilterItem"]] = None, + **kwargs + ): + super(ConnectionMonitorEndpointFilter, self).__init__(**kwargs) + self.items = items + + +class ConnectionMonitorEndpointFilterItem(msrest.serialization.Model): + """Describes the connection monitor endpoint filter item. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of item included in the filter. Currently only 'AgentAddress' is + supported. Default value: "AgentAddress". + :vartype type: str + :param address: The address of the filter item. + :type address: str + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + } + + type = "AgentAddress" + + def __init__( + self, + *, + address: Optional[str] = None, + **kwargs + ): + super(ConnectionMonitorEndpointFilterItem, 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_05_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_05_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 + """ + + _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_05_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Connection monitor output destination type. Currently, only "Workspace" is + supported. Default value: "Workspace". + :vartype type: str + :param workspace_settings: Describes the settings for producing output into a log analytics + workspace. + :type workspace_settings: + ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorWorkspaceSettings + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_settings': {'key': 'workspaceSettings', 'type': 'ConnectionMonitorWorkspaceSettings'}, + } + + type = "Workspace" + + def __init__( + self, + *, + workspace_settings: Optional["ConnectionMonitorWorkspaceSettings"] = None, + **kwargs + ): + super(ConnectionMonitorOutput, self).__init__(**kwargs) + 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_05_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _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_05_01.models.ConnectionMonitorSourceStatus + :param states: Information about connection states. + :type states: list[~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ConnectionMonitorType + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + '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_05_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_05_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_05_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ConnectionMonitorType + """ + + _validation = { + '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}, + } + + _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 + """ + + _attribute_map = { + 'port': {'key': 'port', 'type': 'int'}, + 'disable_trace_route': {'key': 'disableTraceRoute', 'type': 'bool'}, + } + + def __init__( + self, + *, + port: Optional[int] = None, + disable_trace_route: Optional[bool] = None, + **kwargs + ): + super(ConnectionMonitorTcpConfiguration, self).__init__(**kwargs) + self.port = port + self.disable_trace_route = disable_trace_route + + +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_05_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_05_01.models.PreferredIPVersion + :param http_configuration: The parameters used to perform test evaluation over HTTP. + :type http_configuration: + ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorHttpConfiguration + :param tcp_configuration: The parameters used to perform test evaluation over TCP. + :type tcp_configuration: + ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorTcpConfiguration + :param icmp_configuration: The parameters used to perform test evaluation over ICMP. + :type icmp_configuration: + ~azure.mgmt.network.v2020_05_01.models.ConnectionMonitorIcmpConfiguration + :param success_threshold: The threshold for declaring a test successful. + :type success_threshold: + ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.EvaluationState + :param avg_latency_in_ms: Average latency in ms. + :type avg_latency_in_ms: int + :param min_latency_in_ms: Minimum latency in ms. + :type min_latency_in_ms: int + :param max_latency_in_ms: Maximum latency in ms. + :type max_latency_in_ms: int + :param probes_sent: The number of sent probes. + :type probes_sent: int + :param probes_failed: The number of failed probes. + :type probes_failed: int + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2020_05_01.models.ConnectivityHop] + """ + + _validation = { + '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': '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'}, + '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 + """ + + _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_05_01.models.HopLink] + :ivar previous_links: List of previous hop links. + :vartype previous_links: list[~azure.mgmt.network.v2020_05_01.models.HopLink] + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: "Error", "Warning". + :vartype severity: str or ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ConnectivitySource + :param destination: Required. The destination of connection. + :type destination: ~azure.mgmt.network.v2020_05_01.models.ConnectivityDestination + :param protocol: Network protocol. Possible values include: "Tcp", "Http", "Https", "Icmp". + :type protocol: str or ~azure.mgmt.network.v2020_05_01.models.Protocol + :param protocol_configuration: Configuration of the protocol. + :type protocol_configuration: ~azure.mgmt.network.v2020_05_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_05_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}, + } + + _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_05_01.models.ContainerNetworkInterfaceConfiguration + :param container: Reference to the container to which this container network interface is + attached. + :type container: ~azure.mgmt.network.v2020_05_01.models.SubResource + :ivar ip_configurations: Reference to the ip configuration on this container nic. + :vartype ip_configurations: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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 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_05_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_05_01.models.SubResource] + :param protocol_custom_settings: The protocol-specific DDoS policy customization parameters. + :type protocol_custom_settings: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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 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_05_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2020_05_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_05_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_05_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values include: "Active", "Invalid". + :type state: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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: ~azure.mgmt.network.v2020_05_01.models.Resource + :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'}, + 'virtual_wan_resource_type': {'key': 'virtualWanResourceType', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional["Resource"] = 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_05_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_05_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_05_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_05_01.models.MatchedRule + :ivar rules_evaluation_result: List of network security rules evaluation results. + :vartype rules_evaluation_result: + list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_05_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_05_01.models.ExpressRouteCircuitPeeringConfig + :param stats: The peering stats of express route circuit. + :type stats: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.SubResource + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2020_05_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param express_route_connection: The ExpressRoute connection. + :type express_route_connection: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values include: "UnlimitedData", "MeteredData". + :type family: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.ProvisioningState + :param express_route_circuit_peering: The ExpressRoute circuit peering. + :type express_route_circuit_peering: + ~azure.mgmt.network.v2020_05_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 routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_05_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'}, + '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, + 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.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_05_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 + :param peering_location: The peering location of the ExpressRoute circuit. + :type peering_location: str + :param bandwidth_in_mbps: The circuit bandwidth In Mbps. + :type bandwidth_in_mbps: int + :param express_route_circuit: The ExpressRouteCircuit. + :type express_route_circuit: + ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ProvisioningState + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_05_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}, + '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, + peering_location: Optional[str] = None, + bandwidth_in_mbps: Optional[int] = 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 = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps + 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_05_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_05_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration + :ivar express_route_connections: List of ExpressRoute connections to the ExpressRoute gateway. + :vartype express_route_connections: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ProvisioningState + :param mac_sec_config: MacSec configuration. + :type mac_sec_config: ~azure.mgmt.network.v2020_05_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_05_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: "gcm-aes-128", "gcm-aes-256". + :type cipher: str or ~azure.mgmt.network.v2020_05_01.models.ExpressRouteLinkMacSecCipher + """ + + _attribute_map = { + 'ckn_secret_identifier': {'key': 'cknSecretIdentifier', 'type': 'str'}, + 'cak_secret_identifier': {'key': 'cakSecretIdentifier', 'type': 'str'}, + 'cipher': {'key': 'cipher', 'type': 'str'}, + } + + def __init__( + self, + *, + ckn_secret_identifier: Optional[str] = None, + cak_secret_identifier: Optional[str] = None, + cipher: Optional[Union[str, "ExpressRouteLinkMacSecCipher"]] = None, + **kwargs + ): + super(ExpressRouteLinkMacSecConfig, self).__init__(**kwargs) + self.ckn_secret_identifier = ckn_secret_identifier + self.cak_secret_identifier = cak_secret_identifier + self.cipher = cipher + + +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_05_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_05_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_05_01.models.ExpressRouteLink] + :ivar circuits: Reference the ExpressRoute circuit(s) that are provisioned on this + ExpressRoutePort resource. + :vartype circuits: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 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 + :ivar rule_collection_groups: List of references to FirewallPolicyRuleCollectionGroups. + :vartype rule_collection_groups: list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + :param base_policy: The parent firewall policy from which rules are inherited. + :type base_policy: ~azure.mgmt.network.v2020_05_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_05_01.models.SubResource] + :ivar child_policies: List of references to Child Firewall Policies. + :vartype child_policies: list[~azure.mgmt.network.v2020_05_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_05_01.models.AzureFirewallThreatIntelMode + :param threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. + :type threat_intel_whitelist: + ~azure.mgmt.network.v2020_05_01.models.FirewallPolicyThreatIntelWhitelist + :param dns_settings: DNS Proxy Settings definition. + :type dns_settings: ~azure.mgmt.network.v2020_05_01.models.DnsSettings + """ + + _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'}, + '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'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = 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, + **kwargs + ): + super(FirewallPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + 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 + + +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_05_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: Optional[str] = None + 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_05_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_05_01.models.FirewallPolicyFilterRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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: str = 'FirewallPolicyFilterRuleCollection' + 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_05_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 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_05_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_05_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_05_01.models.FirewallPolicyNatRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_05_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: str = 'FirewallPolicyNatRuleCollection' + self.action = action + self.rules = rules + + +class FirewallPolicyNatRuleCollectionAction(msrest.serialization.Model): + """Properties of the FirewallPolicyNatRuleCollectionAction. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of action. Default value: "DNAT". + :vartype type: str + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "DNAT" + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyNatRuleCollectionAction, self).__init__(**kwargs) + + +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_05_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_05_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_05_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_05_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 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 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_05_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_05_01.models.FlowLogFormatParameters + :param flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :type flow_analytics_configuration: + ~azure.mgmt.network.v2020_05_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_05_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The file type of flow log. Default value: "JSON". + :vartype type: str + :param version: The version (revision) of the flow log. + :type version: int + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + } + + type = "JSON" + + def __init__( + self, + *, + version: Optional[int] = 0, + **kwargs + ): + super(FlowLogFormatParameters, self).__init__(**kwargs) + 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_05_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_05_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.IPVersion + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.Subnet + :param public_ip_address: The reference to the Public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_01.models.PublicIPAddress + :param public_ip_prefix: The reference to the Public IP Prefix resource. + :type public_ip_prefix: ~azure.mgmt.network.v2020_05_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_05_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_05_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 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_05_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: int + :ivar round_trip_time_avg: Average roundtrip time in milliseconds. + :vartype round_trip_time_avg: int + :ivar round_trip_time_max: Maximum roundtrip time in milliseconds. + :vartype round_trip_time_max: int + """ + + _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}, + 'round_trip_time_avg': {'readonly': True}, + 'round_trip_time_max': {'readonly': True}, + } + + _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': 'int'}, + 'round_trip_time_avg': {'key': 'properties.roundTripTimeAvg', 'type': 'int'}, + 'round_trip_time_max': {'key': 'properties.roundTripTimeMax', 'type': 'int'}, + } + + 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar method: HTTP method. Default value: "Get". + :vartype method: str + :param headers: List of HTTP headers. + :type headers: list[~azure.mgmt.network.v2020_05_01.models.HTTPHeader] + :param valid_status_codes: Valid status codes. + :type valid_status_codes: list[int] + """ + + _validation = { + 'method': {'constant': True}, + } + + _attribute_map = { + 'method': {'key': 'method', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '[HTTPHeader]'}, + 'valid_status_codes': {'key': 'validStatusCodes', 'type': '[int]'}, + } + + method = "Get" + + def __init__( + self, + *, + headers: Optional[List["HTTPHeader"]] = None, + valid_status_codes: Optional[List[int]] = None, + **kwargs + ): + super(HTTPConfiguration, self).__init__(**kwargs) + 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_05_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_05_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 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_05_01.models.SubResource + :ivar virtual_network: The VirtualNetwork that using the prefix of this IpAllocation resource. + :vartype virtual_network: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.ProvisioningState + :param ip_addresses: IpAddresses/IpAddressPrefixes in the IpGroups resource. + :type ip_addresses: list[str] + :ivar firewalls: List of references to Azure resources that this IpGroups is associated with. + :vartype firewalls: list[~azure.mgmt.network.v2020_05_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'firewalls': {'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]'}, + } + + 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 + + +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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference to the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param state: The state of peering. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer. + :type probes: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.InboundNatPool] + :param outbound_rules: The outbound rules. + :type outbound_rules: list[~azure.mgmt.network.v2020_05_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_05_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}'}, + '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, + 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.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_05_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_05_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'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + virtual_network: Optional["SubResource"] = None, + ip_address: Optional[str] = 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 + + +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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "LoadBalancerSkuName"]] = None, + **kwargs + ): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = name + + +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_05_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_05_01.models.SubResource + :param probe: The reference to the load balancer probe used by the load balancing rule. + :type probe: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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. + + 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 rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :ivar state: The state of the managed rule. Defaults to Disabled if not specified. Default + value: "Disabled". + :vartype state: str + """ + + _validation = { + 'rule_id': {'required': True}, + 'state': {'constant': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + state = "Disabled" + + def __init__( + self, + *, + rule_id: str, + **kwargs + ): + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = rule_id + + +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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource] + :ivar subnets: An array of references to the subnets using this nat gateway resource. + :vartype subnets: list[~azure.mgmt.network.v2020_05_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_05_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_05_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of Nat Gateway SKU. Default value: "Standard". + :vartype name: str + """ + + _validation = { + 'name': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "Standard" + + def __init__( + self, + **kwargs + ): + super(NatGatewaySku, self).__init__(**kwargs) + + +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_05_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_05_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] + """ + + _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]'}, + } + + 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, + **kwargs + ): + super(NatRule, self).__init__(name=name, description=description, **kwargs) + self.rule_type: str = 'NatRule' + 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 + + +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_05_01.models.VerbosityLevel + :param profiles: Required. List of network configuration diagnostic profiles. + :type profiles: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.NetworkConfigurationDiagnosticProfile + :param network_security_group_result: Network security group result. + :type network_security_group_result: + ~azure.mgmt.network.v2020_05_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_05_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] + :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_05_01.models.SubResource + :param network_security_group: The reference to the NetworkSecurityGroup resource. + :type network_security_group: ~azure.mgmt.network.v2020_05_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_05_01.models.PrivateEndpoint + :param ip_configurations: A list of IPConfigurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceIPConfiguration] + :ivar tap_configurations: A list of TapConfigurations of the network interface. + :vartype tap_configurations: + list[~azure.mgmt.network.v2020_05_01.models.NetworkInterfaceTapConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: ~azure.mgmt.network.v2020_05_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 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_05_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}, + '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'}, + '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]'}, + '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, + 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.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.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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.ProvisioningState + :ivar private_link_connection_properties: PrivateLinkConnection properties for the network + interface. + :vartype private_link_connection_properties: + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_05_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: str = 'NetworkRule' + 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_05_01.models.SecurityRule] + :ivar default_security_rules: The default security rules of network security group. + :vartype default_security_rules: list[~azure.mgmt.network.v2020_05_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network interfaces. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_05_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_05_01.models.Subnet] + :ivar flow_logs: A collection of references to flow log resources. + :vartype flow_logs: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.VirtualApplianceSkuProperties + :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_05_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_05_01.models.VirtualApplianceNicProperties] + :ivar virtual_appliance_sites: List of references to VirtualApplianceSite. + :vartype virtual_appliance_sites: list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'virtual_appliance_asn': {'maximum': 4294967295, 'minimum': 0}, + 'virtual_appliance_nics': {'readonly': True}, + 'virtual_appliance_sites': {'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'}, + '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]'}, + '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.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.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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 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_05_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_05_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_05_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_05_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_05_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.RoutingConfiguration + :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_05_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'}, + '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, + **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.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_05_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_05_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_05_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_05_01.models.SubResource + :ivar vpn_client_connection_health: All P2S VPN clients' connection health status. + :vartype vpn_client_connection_health: + ~azure.mgmt.network.v2020_05_01.models.VpnClientConnectionHealth + :param custom_dns_servers: List of all customer specified DNS servers IP addresses. + :type custom_dns_servers: list[str] + """ + + _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]'}, + } + + 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, + **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 + + +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_05_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_05_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_05_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + '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_05_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_05_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_05_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_05_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + '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_05_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_05_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_05_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + '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': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + '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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_05_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + '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_05_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. Default value: "Community". + :vartype route_filter_rule_type: str + :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_05_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'route_filter_rule_type': {'constant': 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'}, + } + + route_filter_rule_type = "Community" + + def __init__( + self, + *, + id: Optional[str] = None, + access: Optional[Union[str, "Access"]] = None, + communities: Optional[List[str]] = None, + **kwargs + ): + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.name = None + self.etag = None + self.access = access + 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_05_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_05_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_05_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_05_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_05_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 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_05_01.models.WebApplicationFirewallEnabledState + :param mode: The mode of the policy. Possible values include: "Prevention", "Detection". + :type mode: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.PrivateLinkServiceConnection] + :param custom_dns_configs: An array of custom dns configurations. + :type custom_dns_configs: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.FrontendIPConfiguration] + :param ip_configurations: An array of private link service IP configurations. + :type ip_configurations: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.PrivateEndpointConnection] + :param visibility: The visibility list of the private link service. + :type visibility: ~azure.mgmt.network.v2020_05_01.models.ResourceSet + :param auto_approval: The auto-approval list of the private link service. + :type auto_approval: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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 sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP address. + :vartype ip_configuration: ~azure.mgmt.network.v2020_05_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_05_01.models.PublicIPAddressDnsSettings + :param ddos_settings: The DDoS protection custom policy associated with the public IP address. + :type ddos_settings: ~azure.mgmt.network.v2020_05_01.models.DdosSettings + :param ip_tags: The list of tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.network.v2020_05_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_05_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_05_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}'}, + '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, + 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.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_05_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_05_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "PublicIPAddressSkuName"]] = None, + **kwargs + ): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = name + + +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 sku: The public IP prefix SKU. + :type sku: ~azure.mgmt.network.v2020_05_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_05_01.models.IPVersion + :param ip_tags: The list of tags associated with the public IP prefix. + :type ip_tags: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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}'}, + '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'}, + '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["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, + **kwargs + ): + super(PublicIPPrefix, self).__init__(id=id, location=location, tags=tags, **kwargs) + 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.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_05_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of a public IP prefix SKU. Default value: "Standard". + :vartype name: str + """ + + _validation = { + 'name': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "Standard" + + def __init__( + self, + **kwargs + ): + super(PublicIPPrefixSku, self).__init__(**kwargs) + + +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_05_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_05_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_05_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_05_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_05_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_05_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_05_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. Default value: "Community". + :vartype route_filter_rule_type: str + :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_05_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'route_filter_rule_type': {'constant': 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'}, + } + + route_filter_rule_type = "Community" + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + location: Optional[str] = None, + access: Optional[Union[str, "Access"]] = 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.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_05_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_05_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_05_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.SubResource + :param propagated_route_tables: The list of RouteTables to advertise the routes to. + :type propagated_route_tables: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SecurityPartnerProviderConnectionStatus + :param virtual_hub: The virtualHub to which the Security Partner Provider belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.NetworkInterfaceAssociation + :param subnet_association: Subnet and it's custom security rules. + :type subnet_association: ~azure.mgmt.network.v2020_05_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_05_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.ServiceEndpointPolicyDefinition] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ServiceTagInformation] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'change_number': {'readonly': True}, + 'cloud': {'readonly': True}, + 'values': {'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]'}, + } + + 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 + + +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_05_01.models.NetworkSecurityGroup + :param route_table: The reference to the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2020_05_01.models.RouteTable + :param nat_gateway: Nat gateway associated with this subnet. + :type nat_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPropertiesFormat] + :param service_endpoint_policies: An array of service endpoint policies. + :type service_endpoint_policies: + list[~azure.mgmt.network.v2020_05_01.models.ServiceEndpointPolicy] + :ivar private_endpoints: An array of references to private endpoints. + :vartype private_endpoints: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.IPConfigurationProfile] + :param ip_allocations: Array of IpAllocation which reference this subnet. + :type ip_allocations: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.ServiceAssociationLink] + :param delegations: An array of references to the delegations on the subnet. + :type delegations: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param target_subnet: The reference to the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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 + :ivar unit: Required. An enum describing the unit of measurement. Default value: "Count". + :vartype unit: str + :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_05_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': 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'}, + } + + unit = "Count" + + def __init__( + self, + *, + current_value: int, + limit: int, + name: "UsageName", + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = None + 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_05_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_05_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values include: "TCP", "UDP". + :type protocol: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param vpn_gateway: The VpnGateway associated with this VirtualHub. + :type vpn_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param p2_s_vpn_gateway: The P2SVpnGateway associated with this VirtualHub. + :type p2_s_vpn_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param express_route_gateway: The expressRouteGateway associated with this VirtualHub. + :type express_route_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param azure_firewall: The azureFirewall associated with this VirtualHub. + :type azure_firewall: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param security_partner_provider: The securityPartnerProvider associated with this VirtualHub. + :type security_partner_provider: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_01.models.RoutingState + :ivar bgp_connections: List of references to Bgp Connections. + :vartype bgp_connections: list[~azure.mgmt.network.v2020_05_01.models.SubResource] + :ivar ip_configurations: List of references to IpConfigurations. + :vartype ip_configurations: list[~azure.mgmt.network.v2020_05_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] + """ + + _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]'}, + } + + 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, + **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 + + +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_05_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_05_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_05_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_05_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] + :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_05_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_05_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2020_05_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.VirtualNetworkBgpCommunities + :param ip_allocations: Array of IpAllocation which reference this VNET. + :type ip_allocations: list[~azure.mgmt.network.v2020_05_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}'}, + '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, + 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.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_05_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible values include: "Vpn", + "ExpressRoute". + :type gateway_type: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_05_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_05_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_05_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 + """ + + _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'}, + } + + 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, + **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 + + +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_05_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: ~azure.mgmt.network.v2020_05_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_05_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_05_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 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_05_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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'}, + '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, + 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.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_05_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2020_05_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.VirtualNetworkGatewayConnectionProtocol + :param routing_weight: The routing weight. + :type routing_weight: int + :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_05_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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'}, + '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, + 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.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_05_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_05_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_05_01.models.SubResource + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param remote_address_space: The reference to the remote virtual network address space. + :type remote_address_space: ~azure.mgmt.network.v2020_05_01.models.AddressSpace + :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_05_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_05_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'}, + '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, + 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.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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource + :param hosted_gateway: The Gateway on which VirtualRouter is hosted. + :type hosted_gateway: ~azure.mgmt.network.v2020_05_01.models.SubResource + :ivar peerings: List of references to VirtualRouterPeerings. + :vartype peerings: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_01.models.SubResource] + :ivar vpn_sites: List of VpnSites in the VirtualWAN. + :vartype vpn_sites: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network + gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.ProcessorArchitecture + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01.models.SubResource + :param routing_weight: Routing weight for vpn connection. + :type routing_weight: int + :param dpd_timeout_seconds: The dead peer detection timeout for a vpn connection in seconds. + :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_05_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_05_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_05_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_05_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_05_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_05_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 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_05_01.models.SubResource + :param connections: List of all vpn connections to the gateway. + :type connections: list[~azure.mgmt.network.v2020_05_01.models.VpnConnection] + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_05_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_05_01.models.ProvisioningState + :param vpn_gateway_scale_unit: The scale unit for this vpn gateway. + :type vpn_gateway_scale_unit: int + """ + + _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_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'}, + } + + 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, + **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 + + +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_05_01.models.VpnGatewayTunnelingProtocol] + :param vpn_authentication_types: VPN authentication types for the VpnServerConfiguration. + :type vpn_authentication_types: list[str or + ~azure.mgmt.network.v2020_05_01.models.VpnAuthenticationType] + :param vpn_client_root_certificates: VPN client root certificate of VpnServerConfiguration. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnServerConfigVpnClientRootCertificate] + :param vpn_client_revoked_certificates: VPN client revoked certificate of + VpnServerConfiguration. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnServerConfigVpnClientRevokedCertificate] + :param radius_server_root_certificates: Radius Server root certificate of + VpnServerConfiguration. + :type radius_server_root_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnServerConfigRadiusServerRootCertificate] + :param radius_client_root_certificates: Radius client root certificate of + VpnServerConfiguration. + :type radius_client_root_certificates: + list[~azure.mgmt.network.v2020_05_01.models.VpnServerConfigRadiusClientRootCertificate] + :param vpn_client_ipsec_policies: VpnClientIpsecPolicies for VpnServerConfiguration. + :type vpn_client_ipsec_policies: list[~azure.mgmt.network.v2020_05_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_05_01.models.RadiusServer] + :param aad_authentication_parameters: The set of aad vpn authentication parameters. + :type aad_authentication_parameters: + ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.SubResource + :param device_properties: The device properties. + :type device_properties: ~azure.mgmt.network.v2020_05_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_05_01.models.AddressSpace + :param bgp_properties: The set of bgp properties. + :type bgp_properties: ~azure.mgmt.network.v2020_05_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_05_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_05_01.models.VpnSiteLink] + """ + + _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]'}, + } + + 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, + **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 + + +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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_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_05_01.models.WebApplicationFirewallRuleType + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.network.v2020_05_01.models.MatchCondition] + :param action: Required. Type of Actions. Possible values include: "Allow", "Block", "Log". + :type action: str or ~azure.mgmt.network.v2020_05_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_05_01.models.PolicySettings + :param custom_rules: The custom rules inside the policy. + :type custom_rules: + list[~azure.mgmt.network.v2020_05_01.models.WebApplicationFirewallCustomRule] + :ivar application_gateways: A collection of references to application gateways. + :vartype application_gateways: list[~azure.mgmt.network.v2020_05_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_05_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_05_01.models.WebApplicationFirewallPolicyResourceState + :param managed_rules: Describes the managedRules structure. + :type managed_rules: ~azure.mgmt.network.v2020_05_01.models.ManagedRulesDefinition + :ivar http_listeners: A collection of references to application gateway http listeners. + :vartype http_listeners: list[~azure.mgmt.network.v2020_05_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_05_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_05_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_05_01/models/_network_management_client_enums.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_network_management_client_enums.py new file mode 100644 index 000000000000..e17854d85b87 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_network_management_client_enums.py @@ -0,0 +1,1103 @@ +# 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 + +class Access(str, Enum): + """Access to be allowed or denied. + """ + + allow = "Allow" + deny = "Deny" + +class ApplicationGatewayBackendHealthServerHealth(str, Enum): + """Health of backend server. + """ + + unknown = "Unknown" + up = "Up" + down = "Down" + partial = "Partial" + draining = "Draining" + +class ApplicationGatewayCookieBasedAffinity(str, Enum): + """Cookie based affinity. + """ + + enabled = "Enabled" + disabled = "Disabled" + +class ApplicationGatewayCustomErrorStatusCode(str, Enum): + """Status code of the application gateway customer error. + """ + + http_status403 = "HttpStatus403" + http_status502 = "HttpStatus502" + +class ApplicationGatewayFirewallMode(str, Enum): + """Web application firewall mode. + """ + + detection = "Detection" + prevention = "Prevention" + +class ApplicationGatewayOperationalState(str, Enum): + """Operational state of the application gateway resource. + """ + + stopped = "Stopped" + starting = "Starting" + running = "Running" + stopping = "Stopping" + +class ApplicationGatewayProtocol(str, Enum): + """Application Gateway protocol. + """ + + http = "Http" + https = "Https" + +class ApplicationGatewayRedirectType(str, Enum): + """Redirect type enum. + """ + + permanent = "Permanent" + found = "Found" + see_other = "SeeOther" + temporary = "Temporary" + +class ApplicationGatewayRequestRoutingRuleType(str, Enum): + """Rule type. + """ + + basic = "Basic" + path_based_routing = "PathBasedRouting" + +class ApplicationGatewaySkuName(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(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(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(str, Enum): + """Type of Ssl Policy. + """ + + predefined = "Predefined" + custom = "Custom" + +class ApplicationGatewaySslProtocol(str, Enum): + """Ssl protocol enums. + """ + + tl_sv1_0 = "TLSv1_0" + tl_sv1_1 = "TLSv1_1" + tl_sv1_2 = "TLSv1_2" + +class ApplicationGatewayTier(str, Enum): + """Tier of an application gateway. + """ + + standard = "Standard" + waf = "WAF" + standard_v2 = "Standard_v2" + waf_v2 = "WAF_v2" + +class AssociationType(str, Enum): + """The association type of the child resource to the parent resource. + """ + + associated = "Associated" + contains = "Contains" + +class AuthenticationMethod(str, Enum): + """VPN client authentication method. + """ + + eaptls = "EAPTLS" + eapmscha_pv2 = "EAPMSCHAPv2" + +class AuthorizationUseStatus(str, Enum): + """The authorization use status. + """ + + available = "Available" + in_use = "InUse" + +class AzureFirewallApplicationRuleProtocolType(str, Enum): + """The protocol type of a Application Rule resource. + """ + + http = "Http" + https = "Https" + mssql = "Mssql" + +class AzureFirewallNatRCActionType(str, Enum): + """The action type of a NAT rule collection. + """ + + snat = "Snat" + dnat = "Dnat" + +class AzureFirewallNetworkRuleProtocol(str, Enum): + """The protocol of a Network Rule resource. + """ + + tcp = "TCP" + udp = "UDP" + any = "Any" + icmp = "ICMP" + +class AzureFirewallRCActionType(str, Enum): + """The action type of a rule collection. + """ + + allow = "Allow" + deny = "Deny" + +class AzureFirewallSkuName(str, Enum): + """Name of an Azure Firewall SKU. + """ + + azfw_vnet = "AZFW_VNet" + azfw_hub = "AZFW_Hub" + +class AzureFirewallSkuTier(str, Enum): + """Tier of an Azure Firewall. + """ + + standard = "Standard" + premium = "Premium" + +class AzureFirewallThreatIntelMode(str, Enum): + """The operation mode for Threat Intel. + """ + + alert = "Alert" + deny = "Deny" + off = "Off" + +class BastionConnectProtocol(str, Enum): + """The protocol used to connect to the target. + """ + + ssh = "SSH" + rdp = "RDP" + +class BgpPeerState(str, Enum): + """The BGP peer state. + """ + + unknown = "Unknown" + stopped = "Stopped" + idle = "Idle" + connecting = "Connecting" + connected = "Connected" + +class CircuitConnectionStatus(str, Enum): + """Express Route Circuit connection state. + """ + + connected = "Connected" + connecting = "Connecting" + disconnected = "Disconnected" + +class ConnectionMonitorSourceStatus(str, Enum): + """Status of connection monitor source. + """ + + unknown = "Unknown" + active = "Active" + inactive = "Inactive" + +class ConnectionMonitorTestConfigurationProtocol(str, Enum): + """The protocol to use in test evaluation. + """ + + tcp = "Tcp" + http = "Http" + icmp = "Icmp" + +class ConnectionMonitorType(str, Enum): + """Type of connection monitor. + """ + + multi_endpoint = "MultiEndpoint" + single_source_destination = "SingleSourceDestination" + +class ConnectionState(str, Enum): + """The connection state. + """ + + reachable = "Reachable" + unreachable = "Unreachable" + unknown = "Unknown" + +class ConnectionStatus(str, Enum): + """The connection status. + """ + + unknown = "Unknown" + connected = "Connected" + disconnected = "Disconnected" + degraded = "Degraded" + +class DdosCustomPolicyProtocol(str, Enum): + """The protocol for which the DDoS protection policy is being customized. + """ + + tcp = "Tcp" + udp = "Udp" + syn = "Syn" + +class DdosCustomPolicyTriggerSensitivityOverride(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(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 DhGroup(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(str, Enum): + """The direction of the traffic. + """ + + inbound = "Inbound" + outbound = "Outbound" + +class EffectiveRouteSource(str, Enum): + """Who created the route. + """ + + unknown = "Unknown" + user = "User" + virtual_network_gateway = "VirtualNetworkGateway" + default = "Default" + +class EffectiveRouteState(str, Enum): + """The value of effective route. + """ + + active = "Active" + invalid = "Invalid" + +class EffectiveSecurityRuleProtocol(str, Enum): + """The network protocol this rule applies to. + """ + + tcp = "Tcp" + udp = "Udp" + all = "All" + +class EvaluationState(str, Enum): + """Connectivity analysis evaluation state. + """ + + not_started = "NotStarted" + in_progress = "InProgress" + completed = "Completed" + +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): + """The advertised public prefix state of the Peering resource. + """ + + not_configured = "NotConfigured" + configuring = "Configuring" + configured = "Configured" + validation_needed = "ValidationNeeded" + +class ExpressRouteCircuitPeeringState(str, Enum): + """The state of peering. + """ + + disabled = "Disabled" + enabled = "Enabled" + +class ExpressRouteCircuitSkuFamily(str, Enum): + """The family of the SKU. + """ + + unlimited_data = "UnlimitedData" + metered_data = "MeteredData" + +class ExpressRouteCircuitSkuTier(str, Enum): + """The tier of the SKU. + """ + + standard = "Standard" + premium = "Premium" + basic = "Basic" + local = "Local" + +class ExpressRouteLinkAdminState(str, Enum): + """Administrative state of the physical port. + """ + + enabled = "Enabled" + disabled = "Disabled" + +class ExpressRouteLinkConnectorType(str, Enum): + """Physical fiber port type. + """ + + lc = "LC" + sc = "SC" + +class ExpressRouteLinkMacSecCipher(str, Enum): + """Mac security cipher. + """ + + gcm_aes128 = "gcm-aes-128" + gcm_aes256 = "gcm-aes-256" + +class ExpressRoutePeeringState(str, Enum): + """The state of peering. + """ + + disabled = "Disabled" + enabled = "Enabled" + +class ExpressRoutePeeringType(str, Enum): + """The peering type. + """ + + azure_public_peering = "AzurePublicPeering" + azure_private_peering = "AzurePrivatePeering" + microsoft_peering = "MicrosoftPeering" + +class ExpressRoutePortsEncapsulation(str, Enum): + """Encapsulation method on physical ports. + """ + + dot1_q = "Dot1Q" + qin_q = "QinQ" + +class FirewallPolicyFilterRuleCollectionActionType(str, Enum): + """The action type of a rule. + """ + + allow = "Allow" + deny = "Deny" + +class FirewallPolicyRuleApplicationProtocolType(str, Enum): + """The application protocol type of a Rule. + """ + + http = "Http" + https = "Https" + +class FirewallPolicyRuleCollectionType(str, Enum): + """The type of the rule collection. + """ + + firewall_policy_nat_rule_collection = "FirewallPolicyNatRuleCollection" + firewall_policy_filter_rule_collection = "FirewallPolicyFilterRuleCollection" + +class FirewallPolicyRuleNetworkProtocol(str, Enum): + """The Network protocol of a Rule. + """ + + tcp = "TCP" + udp = "UDP" + any = "Any" + icmp = "ICMP" + +class FirewallPolicyRuleType(str, Enum): + """Rule Type. + """ + + application_rule = "ApplicationRule" + network_rule = "NetworkRule" + nat_rule = "NatRule" + +class HTTPConfigurationMethod(str, Enum): + """The HTTP method to use. + """ + + get = "Get" + post = "Post" + +class HubBgpConnectionStatus(str, Enum): + """The current state of the VirtualHub to Peer. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class HubVirtualNetworkConnectionStatus(str, Enum): + """The current state of the VirtualHub to vnet connection. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class IkeEncryption(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(str, Enum): + """The IKE integrity algorithm (IKE phase 2). + """ + + md5 = "MD5" + sha1 = "SHA1" + sha256 = "SHA256" + sha384 = "SHA384" + gcmaes256 = "GCMAES256" + gcmaes128 = "GCMAES128" + +class IPAllocationMethod(str, Enum): + """IP address allocation method. + """ + + static = "Static" + dynamic = "Dynamic" + +class IpAllocationType(str, Enum): + """IpAllocation type. + """ + + undefined = "Undefined" + hypernet = "Hypernet" + +class IpFlowProtocol(str, Enum): + """Protocol to be verified on. + """ + + tcp = "TCP" + udp = "UDP" + +class IpsecEncryption(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(str, Enum): + """The IPSec integrity algorithm (IKE phase 1). + """ + + md5 = "MD5" + sha1 = "SHA1" + sha256 = "SHA256" + gcmaes128 = "GCMAES128" + gcmaes192 = "GCMAES192" + gcmaes256 = "GCMAES256" + +class IPVersion(str, Enum): + """IP address version. + """ + + i_pv4 = "IPv4" + i_pv6 = "IPv6" + +class IssueType(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(str, Enum): + """The protocol for the outbound rule in load balancer. + """ + + tcp = "Tcp" + udp = "Udp" + all = "All" + +class LoadBalancerSkuName(str, Enum): + """Name of a load balancer SKU. + """ + + basic = "Basic" + standard = "Standard" + +class LoadDistribution(str, Enum): + """The load distribution policy for this rule. + """ + + default = "Default" + source_ip = "SourceIP" + source_ip_protocol = "SourceIPProtocol" + +class NetworkOperationStatus(str, Enum): + """Status of the Azure async operation. + """ + + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + +class NextHopType(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(str, Enum): + """The office traffic category. + """ + + optimize = "Optimize" + optimize_and_allow = "OptimizeAndAllow" + all = "All" + none = "None" + +class Origin(str, Enum): + """The origin of the issue. + """ + + local = "Local" + inbound = "Inbound" + outbound = "Outbound" + +class OwaspCrsExclusionEntryMatchVariable(str, Enum): + """The variable to be excluded. + """ + + request_header_names = "RequestHeaderNames" + request_cookie_names = "RequestCookieNames" + request_arg_names = "RequestArgNames" + +class OwaspCrsExclusionEntrySelectorMatchOperator(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(str, Enum): + + internal_error = "InternalError" + agent_stopped = "AgentStopped" + capture_failed = "CaptureFailed" + local_file_failed = "LocalFileFailed" + storage_failed = "StorageFailed" + +class PcProtocol(str, Enum): + """Protocol to be filtered on. + """ + + tcp = "TCP" + udp = "UDP" + any = "Any" + +class PcStatus(str, Enum): + """The status of the packet capture session. + """ + + not_started = "NotStarted" + running = "Running" + stopped = "Stopped" + error = "Error" + unknown = "Unknown" + +class PfsGroup(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(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(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(str, Enum): + """VPN client Processor Architecture. + """ + + amd64 = "Amd64" + x86 = "X86" + +class Protocol(str, Enum): + """Network protocol. + """ + + tcp = "Tcp" + http = "Http" + https = "Https" + icmp = "Icmp" + +class ProvisioningState(str, Enum): + """The current provisioning state. + """ + + succeeded = "Succeeded" + updating = "Updating" + deleting = "Deleting" + failed = "Failed" + +class PublicIPAddressSkuName(str, Enum): + """Name of a public IP address SKU. + """ + + basic = "Basic" + standard = "Standard" + +class ResourceIdentityType(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 RouteNextHopType(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(str, Enum): + """The current routing state of the VirtualHub. + """ + + none = "None" + provisioned = "Provisioned" + provisioning = "Provisioning" + failed = "Failed" + +class SecurityPartnerProviderConnectionStatus(str, Enum): + """The current state of the connection with Security Partner Provider. + """ + + unknown = "Unknown" + partially_connected = "PartiallyConnected" + connected = "Connected" + not_connected = "NotConnected" + +class SecurityProviderName(str, Enum): + """The Security Providers. + """ + + z_scaler = "ZScaler" + i_boss = "IBoss" + checkpoint = "Checkpoint" + +class SecurityRuleAccess(str, Enum): + """Whether network traffic is allowed or denied. + """ + + allow = "Allow" + deny = "Deny" + +class SecurityRuleDirection(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(str, Enum): + """Network protocol this rule applies to. + """ + + tcp = "Tcp" + udp = "Udp" + icmp = "Icmp" + esp = "Esp" + asterisk = "*" + ah = "Ah" + +class ServiceProviderProvisioningState(str, Enum): + """The ServiceProviderProvisioningState state of the resource. + """ + + not_provisioned = "NotProvisioned" + provisioning = "Provisioning" + provisioned = "Provisioned" + deprovisioning = "Deprovisioning" + +class Severity(str, Enum): + """The severity of the issue. + """ + + error = "Error" + warning = "Warning" + +class TransportProtocol(str, Enum): + """The transport protocol for the endpoint. + """ + + udp = "Udp" + tcp = "Tcp" + all = "All" + +class TunnelConnectionStatus(str, Enum): + """The current state of the tunnel. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class VerbosityLevel(str, Enum): + """Verbosity level. + """ + + normal = "Normal" + minimum = "Minimum" + full = "Full" + +class VirtualNetworkGatewayConnectionProtocol(str, Enum): + """Gateway connection protocol. + """ + + ik_ev2 = "IKEv2" + ik_ev1 = "IKEv1" + +class VirtualNetworkGatewayConnectionStatus(str, Enum): + """Virtual Network Gateway connection status. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class VirtualNetworkGatewayConnectionType(str, Enum): + """Gateway connection type. + """ + + i_psec = "IPsec" + vnet2_vnet = "Vnet2Vnet" + express_route = "ExpressRoute" + vpn_client = "VPNClient" + +class VirtualNetworkGatewaySkuName(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(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(str, Enum): + """The type of this virtual network gateway. + """ + + vpn = "Vpn" + express_route = "ExpressRoute" + +class VirtualNetworkPeeringState(str, Enum): + """The status of the virtual network peering. + """ + + initiated = "Initiated" + connected = "Connected" + disconnected = "Disconnected" + +class VirtualWanSecurityProviderType(str, Enum): + """The virtual wan security provider type. + """ + + external = "External" + native = "Native" + +class VpnAuthenticationType(str, Enum): + """VPN authentication types enabled for the VpnServerConfiguration. + """ + + certificate = "Certificate" + radius = "Radius" + aad = "AAD" + +class VpnClientProtocol(str, Enum): + """VPN client protocol enabled for the virtual network gateway. + """ + + ike_v2 = "IkeV2" + sstp = "SSTP" + open_vpn = "OpenVPN" + +class VpnConnectionStatus(str, Enum): + """The current state of the vpn connection. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class VpnGatewayGeneration(str, Enum): + """The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. + """ + + none = "None" + generation1 = "Generation1" + generation2 = "Generation2" + +class VpnGatewayTunnelingProtocol(str, Enum): + """VPN protocol enabled for the VpnServerConfiguration. + """ + + ike_v2 = "IkeV2" + open_vpn = "OpenVPN" + +class VpnType(str, Enum): + """The type of this virtual network gateway. + """ + + policy_based = "PolicyBased" + route_based = "RouteBased" + +class WebApplicationFirewallAction(str, Enum): + """Type of Actions. + """ + + allow = "Allow" + block = "Block" + log = "Log" + +class WebApplicationFirewallEnabledState(str, Enum): + """The state of the policy. + """ + + disabled = "Disabled" + enabled = "Enabled" + +class WebApplicationFirewallMatchVariable(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(str, Enum): + """The mode of the policy. + """ + + prevention = "Prevention" + detection = "Detection" + +class WebApplicationFirewallOperator(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(str, Enum): + """Resource status of the policy. + """ + + creating = "Creating" + enabling = "Enabling" + enabled = "Enabled" + disabling = "Disabling" + disabled = "Disabled" + deleting = "Deleting" + +class WebApplicationFirewallRuleType(str, Enum): + """The rule type. + """ + + match_rule = "MatchRule" + invalid = "Invalid" + +class WebApplicationFirewallTransform(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_05_01/operations/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/__init__.py new file mode 100644 index 000000000000..bd9ad96de2ed --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/__init__.py @@ -0,0 +1,215 @@ +# 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 ._bastion_hosts_operations import BastionHostsOperations +from ._network_management_client_operations import NetworkManagementClientOperationsMixin +from ._ddos_custom_policies_operations import DdosCustomPoliciesOperations +from ._ddos_protection_plans_operations import DdosProtectionPlansOperations +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 ._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', + 'BastionHostsOperations', + 'NetworkManagementClientOperationsMixin', + 'DdosCustomPoliciesOperations', + 'DdosProtectionPlansOperations', + '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', + '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_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 new file mode 100644 index 000000000000..b39389af583c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_endpoint_connections_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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ApplicationGatewayPrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..385bb7e9f77e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateway_private_link_resources_operations.py @@ -0,0 +1,118 @@ +# 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 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 + +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_05_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_05_01.models.ApplicationGatewayPrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateLinkResourceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateways_operations.py new file mode 100644 index 000000000000..549eb716c07c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_gateways_operations.py @@ -0,0 +1,1326 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayAvailableWafRuleSetsResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayAvailableSslOptions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ApplicationGatewaySslPredefinedPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..d57c1ccbbcb2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_application_security_groups_operations.py @@ -0,0 +1,524 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_delegations_operations.py new file mode 100644 index 000000000000..ac658e750f0e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_delegations_operations.py @@ -0,0 +1,114 @@ +# 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 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 + +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_05_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_05_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..fd46268b2eb1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_endpoint_services_operations.py @@ -0,0 +1,114 @@ +# 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 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 + +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_05_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_05_01.models.EndpointServicesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..9f916f04a6a4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8bbde23006fa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_available_resource_group_delegations_operations.py @@ -0,0 +1,118 @@ +# 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 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 + +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_05_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_05_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..896a52257e75 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..68b806141542 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -0,0 +1,110 @@ +# 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 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 + +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_05_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_05_01.models.AzureFirewallFqdnTagListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewalls_operations.py new file mode 100644 index 000000000000..a89ca8fdd108 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_azure_firewalls_operations.py @@ -0,0 +1,578 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.AzureFirewall + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bastion_hosts_operations.py new file mode 100644 index 000000000000..e91ec2c9283a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bastion_hosts_operations.py @@ -0,0 +1,458 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.BastionHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..bc1395d23d60 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_bgp_service_communities_operations.py @@ -0,0 +1,110 @@ +# 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 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 + +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_05_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_05_01.models.BgpServiceCommunityListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_connection_monitors_operations.py new file mode 100644 index 000000000000..7553c0f83b27 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_connection_monitors_operations.py @@ -0,0 +1,820 @@ +# 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 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 + +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_05_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" + **kwargs # type: Any + ): + # type: (...) -> "models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + 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" + **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_05_01.models.ConnectionMonitor + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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_05_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, + 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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ConnectionMonitorListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..9a7c7dbbd34a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_custom_policies_operations.py @@ -0,0 +1,390 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..33fdd1bf9ae1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ddos_protection_plans_operations.py @@ -0,0 +1,523 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..e452fba489a0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..d101db014f20 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_authorizations_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuitAuthorization + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.AuthorizationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..a2692f75f694 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_connections_operations.py @@ -0,0 +1,437 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..5967448f4615 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuit_peerings_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuitPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ExpressRouteCircuitPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..a945258e0c4d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_circuits_operations.py @@ -0,0 +1,1005 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..327e373d6827 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_connections_operations.py @@ -0,0 +1,398 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ExpressRouteConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteConnectionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..614f4e46fbc0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connection_peerings_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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_05_01.models.ExpressRouteCrossConnectionPeeringList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRouteCrossConnectionPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_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 new file mode 100644 index 000000000000..216b1bdeb0b4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_cross_connections_operations.py @@ -0,0 +1,787 @@ +# 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 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 + +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_05_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_05_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..7debbd91ec72 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_gateways_operations.py @@ -0,0 +1,427 @@ +# 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 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 + +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_05_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_05_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ExpressRouteGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..76ea3dccc455 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.ExpressRouteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ExpressRouteLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..1a75d51a8a75 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.ExpressRoutePortsLocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRoutePortsLocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..fd87a7d371c5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_ports_operations.py @@ -0,0 +1,523 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 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 new file mode 100644 index 000000000000..5117f6c49722 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_express_route_service_providers_operations.py @@ -0,0 +1,110 @@ +# 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 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 + +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_05_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_05_01.models.ExpressRouteServiceProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policies_operations.py new file mode 100644 index 000000000000..b9399db9aac8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policies_operations.py @@ -0,0 +1,463 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.FirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..d4444854fe9d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_firewall_policy_rule_collection_groups_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.FirewallPolicyRuleCollectionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.FirewallPolicyRuleCollectionGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_flow_logs_operations.py new file mode 100644 index 000000000000..bce82f363a7e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_flow_logs_operations.py @@ -0,0 +1,418 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 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_05_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.FlowLogListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..e75fea9f0c3a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_route_tables_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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.HubRouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListHubRouteTablesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8e015109b253 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_hub_virtual_network_connections_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.HubVirtualNetworkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ListHubVirtualNetworkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..fc33d13f8eac --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_inbound_nat_rules_operations.py @@ -0,0 +1,420 @@ +# 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 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 + +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_05_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_05_01.models.InboundNatRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.InboundNatRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_allocations_operations.py new file mode 100644 index 000000000000..6312db645924 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_allocations_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_groups_operations.py new file mode 100644 index 000000000000..e866240f8e5a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_ip_groups_operations.py @@ -0,0 +1,535 @@ +# 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 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 + +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_05_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_05_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..f11ba0171ef1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_backend_address_pools_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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_05_01.models.LoadBalancerBackendAddressPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.BackendAddressPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..a3bbc3b73ccf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.LoadBalancerFrontendIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.FrontendIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..2252155c3649 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.LoadBalancerLoadBalancingRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.LoadBalancingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..ebfa22cac887 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancer_network_interfaces_operations.py @@ -0,0 +1,118 @@ +# 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 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 + +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_05_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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..2548eddf1453 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.LoadBalancerOutboundRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.OutboundRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..0fd1a3d87c75 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.LoadBalancerProbeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.Probe + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancers_operations.py new file mode 100644 index 000000000000..ee1e372c1a98 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_load_balancers_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..6d259eeeec70 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_local_network_gateways_operations.py @@ -0,0 +1,459 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.LocalNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_nat_gateways_operations.py new file mode 100644 index 000000000000..9e7369738caf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_nat_gateways_operations.py @@ -0,0 +1,531 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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: (...) -> "models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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) + + 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, {}) + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..686dd8823561 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..b2a71e064461 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_load_balancers_operations.py @@ -0,0 +1,118 @@ +# 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 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 + +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_05_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_05_01.models.NetworkInterfaceLoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..f3f6b6444749 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interface_tap_configurations_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkInterfaceTapConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.NetworkInterfaceTapConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interfaces_operations.py new file mode 100644 index 000000000000..4bf97bfa3920 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_interfaces_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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_05_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..4d73e260164b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_management_client_operations.py @@ -0,0 +1,775 @@ +# 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 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 + +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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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["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_05_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 BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_05_01.models.BastionShareableLinkListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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): + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.BastionShareableLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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["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 either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_05_01.models.BastionActiveSessionListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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): + deserialized = self._deserialize('BastionActiveSessionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.BastionSessionDeleteResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = "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'] = 'application/json' + + 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_05_01.models.DnsNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.VirtualWanSecurityProviders + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_profiles_operations.py new file mode 100644 index 000000000000..50b3b3d53cbf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_profiles_operations.py @@ -0,0 +1,475 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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_05_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..a77381e7cb2b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_security_groups_operations.py @@ -0,0 +1,529 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..3fd88209bf1e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_virtual_appliances_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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_05_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_watchers_operations.py new file mode 100644 index 000000000000..f2ba6cbc6efb --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_network_watchers_operations.py @@ -0,0 +1,1904 @@ +# 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 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 + +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_05_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_05_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_05_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_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_05_01.models.Topology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_operations.py new file mode 100644 index 000000000000..d70e192ac592 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_operations.py @@ -0,0 +1,106 @@ +# 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 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 + +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_05_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_05_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..25d66f3c6689 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_p2_svpn_gateways_operations.py @@ -0,0 +1,989 @@ +# 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 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 + +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_05_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_05_01.models.P2SVpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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( + self, + resource_group_name, # type: str + gateway_name, # type: str + p2_s_vpn_gateway_parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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_05_01.models.TagsObject + :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_05_01.models.P2SVpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'), + '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'] = 'application/json' + + 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]: + 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 + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 _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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_packet_captures_operations.py new file mode 100644 index 000000000000..b133ae0388f7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_packet_captures_operations.py @@ -0,0 +1,639 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.PacketCaptureResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PacketCaptureListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..23a943dd13bc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.PeerExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.PeerExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..27d421410ea9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_dns_zone_groups_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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PrivateDnsZoneGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.PrivateDnsZoneGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_endpoints_operations.py new file mode 100644 index 000000000000..446fae8d9d2a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_endpoints_operations.py @@ -0,0 +1,468 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PrivateEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..43e8261d05de --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_private_link_services_operations.py @@ -0,0 +1,1162 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PrivateLinkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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_05_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8c2df70fb3fe --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_addresses_operations.py @@ -0,0 +1,762 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..9fb21ff2f4a8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_public_ip_prefixes_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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_05_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..55361a17438c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_resource_navigation_links_operations.py @@ -0,0 +1,105 @@ +# 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 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 + +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_05_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_05_01.models.ResourceNavigationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..3ad6008d3e3c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filter_rules_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.RouteFilterRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.RouteFilterRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filters_operations.py new file mode 100644 index 000000000000..817bc53a7556 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filters_operations.py @@ -0,0 +1,529 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_tables_operations.py new file mode 100644 index 000000000000..efe727e9f1dd --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_tables_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_routes_operations.py new file mode 100644 index 000000000000..a3ba10f25cc7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_routes_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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.Route + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.RouteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..593b27ae79dc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_partner_providers_operations.py @@ -0,0 +1,524 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_rules_operations.py new file mode 100644 index 000000000000..57cb976f1649 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_security_rules_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..17f404b9ba6b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_association_links_operations.py @@ -0,0 +1,105 @@ +# 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 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 + +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_05_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_05_01.models.ServiceAssociationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..bfb8160bba67 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policies_operations.py @@ -0,0 +1,529 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..69699aded298 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_endpoint_policy_definitions_operations.py @@ -0,0 +1,419 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ServiceEndpointPolicyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ServiceEndpointPolicyDefinitionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_tags_operations.py new file mode 100644 index 000000000000..acb34e3b9dd3 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_service_tags_operations.py @@ -0,0 +1,99 @@ +# 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 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 + +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_05_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_05_01.models.ServiceTagsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_subnets_operations.py new file mode 100644 index 000000000000..2d8960bd06ae --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_subnets_operations.py @@ -0,0 +1,655 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.Subnet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.SubnetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_usages_operations.py new file mode 100644 index 000000000000..108b1151d0bb --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_usages_operations.py @@ -0,0 +1,114 @@ +# 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 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 + +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_05_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_05_01.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8f0904be684a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_appliance_sites_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualApplianceSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.NetworkVirtualApplianceSiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSiteListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..81ce036e38c1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.NetworkVirtualApplianceSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSkuListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.NetworkVirtualApplianceSku + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSku"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..da5e9105cd6b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connection_operations.py @@ -0,0 +1,342 @@ +# 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 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 + +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_05_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_05_01.models.BgpConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..d4e4c9efed97 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_bgp_connections_operations.py @@ -0,0 +1,118 @@ +# 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 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 + +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 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_05_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_05_01.models.ListVirtualHubBgpConnectionResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubBgpConnectionResults"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 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 new file mode 100644 index 000000000000..a348673cd64b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_ip_configuration_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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_05_01.models.HubIpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVirtualHubIpConfigurationResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubIpConfigurationResults"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..ee7004564570 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -0,0 +1,419 @@ +# 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 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 + +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_05_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_05_01.models.VirtualHubRouteTableV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVirtualHubRouteTableV2SResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hubs_operations.py new file mode 100644 index 000000000000..f652fbb5e239 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_hubs_operations.py @@ -0,0 +1,638 @@ +# 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 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 + +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_05_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_05_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..7090beceecaa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateway_connections_operations.py @@ -0,0 +1,1076 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualNetworkGatewayConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.ConnectionSharedKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.VirtualNetworkGatewayConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..f42080acb599 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateways_operations.py @@ -0,0 +1,2321 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.VirtualNetworkGatewayListConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..b671bb592c21 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_peerings_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualNetworkPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualNetworkPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..d438e28c11a7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_taps_operations.py @@ -0,0 +1,523 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_networks_operations.py new file mode 100644 index 000000000000..9ff0339b3c32 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_networks_operations.py @@ -0,0 +1,716 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.IPAddressAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.VirtualNetworkListUsageResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 + + def get_bastion_hosts( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.BastionHostListResult" + """Get a list of bastion hosts accessible from the given 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: BastionHostListResult, or the result of cls(response) + :rtype: ~azure.mgmt.network.v2020_05_01.models.BastionHostListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # Construct URL + url = self.get_bastion_hosts.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'] = 'application/json' + + 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('BastionHostListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_bastion_hosts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/bastionHosts'} # type: ignore 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 new file mode 100644 index 000000000000..f0f35b9c105f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_router_peerings_operations.py @@ -0,0 +1,419 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualRouterPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualRouterPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_routers_operations.py new file mode 100644 index 000000000000..7d5786916903 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_routers_operations.py @@ -0,0 +1,468 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.VirtualRouter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_wans_operations.py new file mode 100644 index 000000000000..dfd9cedd1dbd --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_wans_operations.py @@ -0,0 +1,523 @@ +# 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 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 + +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_05_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_05_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_connections_operations.py new file mode 100644 index 000000000000..5585578a6e1c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_connections_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_05_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_05_01.models.VpnConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 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_05_01.models.ListVpnConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_gateways_operations.py new file mode 100644 index 000000000000..a66077cf2357 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_gateways_operations.py @@ -0,0 +1,633 @@ +# 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 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 + +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_05_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_05_01.models.VpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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( + self, + resource_group_name, # type: str + gateway_name, # type: str + vpn_gateway_parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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_05_01.models.TagsObject + :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_05_01.models.VpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'), + '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'] = 'application/json' + + 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]: + 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 + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 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_05_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..3157a3aa21b9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_link_connections_operations.py @@ -0,0 +1,123 @@ +# 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 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 + +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_05_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 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: An iterator like instance of either ListVpnSiteLinkConnectionsResult or the result of cls(response) + :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"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8661dea7e829 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -0,0 +1,157 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..1873f7514395 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_server_configurations_operations.py @@ -0,0 +1,527 @@ +# 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 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 + +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_05_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_05_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..44aa8994ea38 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_site_link_connections_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 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 + +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_05_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_05_01.models.VpnSiteLinkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8d5f351b6cb2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_05_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_05_01.models.VpnSiteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_01.models.ListVpnSiteLinksResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..22a0cd4f5162 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_configuration_operations.py @@ -0,0 +1,159 @@ +# 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 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 + +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_05_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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') + + 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_05_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_operations.py new file mode 100644 index 000000000000..e91b340c7291 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_vpn_sites_operations.py @@ -0,0 +1,523 @@ +# 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 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 + +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_05_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_05_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_05_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_05_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_05_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_05_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..ca37fe3a35e7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_web_application_firewall_policies_operations.py @@ -0,0 +1,405 @@ +# 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 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 + +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_05_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_05_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_05_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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'] = 'application/json' + + 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_05_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_05_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_05_01/py.typed b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/__init__.py new file mode 100644 index 000000000000..c66f95f71169 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_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 + patch_sdk() +except ImportError: + pass diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_configuration.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_configuration.py new file mode 100644 index 000000000000..8c619e0340c2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_configuration.py @@ -0,0 +1,68 @@ +# 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 + +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 = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + 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.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_06_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_metadata.json new file mode 100644 index 000000000000..f22e6b1d681b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_metadata.json @@ -0,0 +1,288 @@ +{ + "chosen_version": "2020-06-01", + "total_api_version_list": ["2018-10-01", "2020-06-01"], + "client": { + "name": "NetworkManagementClient", + "filename": "_network_management_client", + "description": "Network Client." + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_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", + "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": { + "credential": { + "method_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", + "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"] + }, + "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", + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "async": { + "signature": "async 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[\"models.BastionShareableLinkListResult\"]:\n", + "coroutine": true + }, + "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:return: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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: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" + }, + "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" + }, + "async": { + "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", + "coroutine": false + }, + "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: BastionShareableLinkListResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_06_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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "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" + }, + "async": { + "signature": "async def begin_get_active_sessions(\n self,\n resource_group_name: str,\n bastion_host_name: str,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.BastionActiveSessionListResult\"]:\n", + "coroutine": true + }, + "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:return: BastionActiveSessionListResult, or the result of cls(response)\n:rtype: ~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" + }, + "async": { + "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", + "coroutine": false + }, + "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: BastionSessionDeleteResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2020_06_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" + }, + "async": { + "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs\n) -\u003e \"models.DnsNameAvailabilityResult\":\n", + "coroutine": true + }, + "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" + }, + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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" + }, + "async": { + "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", + "coroutine": true + }, + "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:return: VpnProfileResponse, or the result of cls(response)\n:rtype: ~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" + } + }, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"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\": [\"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_06_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_network_management_client.py new file mode 100644 index 000000000000..897421227dd2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/_network_management_client.py @@ -0,0 +1,585 @@ +# 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 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_06_01.operations.ApplicationGatewaysOperations + :ivar application_gateway_private_link_resources: ApplicationGatewayPrivateLinkResourcesOperations operations + :vartype application_gateway_private_link_resources: azure.mgmt.network.v2020_06_01.operations.ApplicationGatewayPrivateLinkResourcesOperations + :ivar application_gateway_private_endpoint_connections: ApplicationGatewayPrivateEndpointConnectionsOperations operations + :vartype application_gateway_private_endpoint_connections: azure.mgmt.network.v2020_06_01.operations.ApplicationGatewayPrivateEndpointConnectionsOperations + :ivar application_security_groups: ApplicationSecurityGroupsOperations operations + :vartype application_security_groups: azure.mgmt.network.v2020_06_01.operations.ApplicationSecurityGroupsOperations + :ivar available_delegations: AvailableDelegationsOperations operations + :vartype available_delegations: azure.mgmt.network.v2020_06_01.operations.AvailableDelegationsOperations + :ivar available_resource_group_delegations: AvailableResourceGroupDelegationsOperations operations + :vartype available_resource_group_delegations: azure.mgmt.network.v2020_06_01.operations.AvailableResourceGroupDelegationsOperations + :ivar available_service_aliases: AvailableServiceAliasesOperations operations + :vartype available_service_aliases: azure.mgmt.network.v2020_06_01.operations.AvailableServiceAliasesOperations + :ivar azure_firewalls: AzureFirewallsOperations operations + :vartype azure_firewalls: azure.mgmt.network.v2020_06_01.operations.AzureFirewallsOperations + :ivar azure_firewall_fqdn_tags: AzureFirewallFqdnTagsOperations operations + :vartype azure_firewall_fqdn_tags: azure.mgmt.network.v2020_06_01.operations.AzureFirewallFqdnTagsOperations + :ivar bastion_hosts: BastionHostsOperations operations + :vartype bastion_hosts: azure.mgmt.network.v2020_06_01.operations.BastionHostsOperations + :ivar custom_ip_prefixes: CustomIPPrefixesOperations operations + :vartype custom_ip_prefixes: azure.mgmt.network.v2020_06_01.operations.CustomIPPrefixesOperations + :ivar ddos_custom_policies: DdosCustomPoliciesOperations operations + :vartype ddos_custom_policies: azure.mgmt.network.v2020_06_01.operations.DdosCustomPoliciesOperations + :ivar ddos_protection_plans: DdosProtectionPlansOperations operations + :vartype ddos_protection_plans: azure.mgmt.network.v2020_06_01.operations.DdosProtectionPlansOperations + :ivar dscp_configuration: DscpConfigurationOperations operations + :vartype dscp_configuration: azure.mgmt.network.v2020_06_01.operations.DscpConfigurationOperations + :ivar available_endpoint_services: AvailableEndpointServicesOperations operations + :vartype available_endpoint_services: azure.mgmt.network.v2020_06_01.operations.AvailableEndpointServicesOperations + :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations operations + :vartype express_route_circuit_authorizations: azure.mgmt.network.v2020_06_01.operations.ExpressRouteCircuitAuthorizationsOperations + :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations + :vartype express_route_circuit_peerings: azure.mgmt.network.v2020_06_01.operations.ExpressRouteCircuitPeeringsOperations + :ivar express_route_circuit_connections: ExpressRouteCircuitConnectionsOperations operations + :vartype express_route_circuit_connections: azure.mgmt.network.v2020_06_01.operations.ExpressRouteCircuitConnectionsOperations + :ivar peer_express_route_circuit_connections: PeerExpressRouteCircuitConnectionsOperations operations + :vartype peer_express_route_circuit_connections: azure.mgmt.network.v2020_06_01.operations.PeerExpressRouteCircuitConnectionsOperations + :ivar express_route_circuits: ExpressRouteCircuitsOperations operations + :vartype express_route_circuits: azure.mgmt.network.v2020_06_01.operations.ExpressRouteCircuitsOperations + :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations + :vartype express_route_service_providers: azure.mgmt.network.v2020_06_01.operations.ExpressRouteServiceProvidersOperations + :ivar express_route_cross_connections: ExpressRouteCrossConnectionsOperations operations + :vartype express_route_cross_connections: azure.mgmt.network.v2020_06_01.operations.ExpressRouteCrossConnectionsOperations + :ivar express_route_cross_connection_peerings: ExpressRouteCrossConnectionPeeringsOperations operations + :vartype express_route_cross_connection_peerings: azure.mgmt.network.v2020_06_01.operations.ExpressRouteCrossConnectionPeeringsOperations + :ivar express_route_ports_locations: ExpressRoutePortsLocationsOperations operations + :vartype express_route_ports_locations: azure.mgmt.network.v2020_06_01.operations.ExpressRoutePortsLocationsOperations + :ivar express_route_ports: ExpressRoutePortsOperations operations + :vartype express_route_ports: azure.mgmt.network.v2020_06_01.operations.ExpressRoutePortsOperations + :ivar express_route_links: ExpressRouteLinksOperations operations + :vartype express_route_links: azure.mgmt.network.v2020_06_01.operations.ExpressRouteLinksOperations + :ivar firewall_policies: FirewallPoliciesOperations operations + :vartype firewall_policies: azure.mgmt.network.v2020_06_01.operations.FirewallPoliciesOperations + :ivar firewall_policy_rule_collection_groups: FirewallPolicyRuleCollectionGroupsOperations operations + :vartype firewall_policy_rule_collection_groups: azure.mgmt.network.v2020_06_01.operations.FirewallPolicyRuleCollectionGroupsOperations + :ivar ip_allocations: IpAllocationsOperations operations + :vartype ip_allocations: azure.mgmt.network.v2020_06_01.operations.IpAllocationsOperations + :ivar ip_groups: IpGroupsOperations operations + :vartype ip_groups: azure.mgmt.network.v2020_06_01.operations.IpGroupsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: azure.mgmt.network.v2020_06_01.operations.LoadBalancersOperations + :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations + :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2020_06_01.operations.LoadBalancerBackendAddressPoolsOperations + :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations operations + :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2020_06_01.operations.LoadBalancerFrontendIPConfigurationsOperations + :ivar inbound_nat_rules: InboundNatRulesOperations operations + :vartype inbound_nat_rules: azure.mgmt.network.v2020_06_01.operations.InboundNatRulesOperations + :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations + :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2020_06_01.operations.LoadBalancerLoadBalancingRulesOperations + :ivar load_balancer_outbound_rules: LoadBalancerOutboundRulesOperations operations + :vartype load_balancer_outbound_rules: azure.mgmt.network.v2020_06_01.operations.LoadBalancerOutboundRulesOperations + :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations + :vartype load_balancer_network_interfaces: azure.mgmt.network.v2020_06_01.operations.LoadBalancerNetworkInterfacesOperations + :ivar load_balancer_probes: LoadBalancerProbesOperations operations + :vartype load_balancer_probes: azure.mgmt.network.v2020_06_01.operations.LoadBalancerProbesOperations + :ivar nat_gateways: NatGatewaysOperations operations + :vartype nat_gateways: azure.mgmt.network.v2020_06_01.operations.NatGatewaysOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: azure.mgmt.network.v2020_06_01.operations.NetworkInterfacesOperations + :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations operations + :vartype network_interface_ip_configurations: azure.mgmt.network.v2020_06_01.operations.NetworkInterfaceIPConfigurationsOperations + :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations + :vartype network_interface_load_balancers: azure.mgmt.network.v2020_06_01.operations.NetworkInterfaceLoadBalancersOperations + :ivar network_interface_tap_configurations: NetworkInterfaceTapConfigurationsOperations operations + :vartype network_interface_tap_configurations: azure.mgmt.network.v2020_06_01.operations.NetworkInterfaceTapConfigurationsOperations + :ivar network_profiles: NetworkProfilesOperations operations + :vartype network_profiles: azure.mgmt.network.v2020_06_01.operations.NetworkProfilesOperations + :ivar network_security_groups: NetworkSecurityGroupsOperations operations + :vartype network_security_groups: azure.mgmt.network.v2020_06_01.operations.NetworkSecurityGroupsOperations + :ivar security_rules: SecurityRulesOperations operations + :vartype security_rules: azure.mgmt.network.v2020_06_01.operations.SecurityRulesOperations + :ivar default_security_rules: DefaultSecurityRulesOperations operations + :vartype default_security_rules: azure.mgmt.network.v2020_06_01.operations.DefaultSecurityRulesOperations + :ivar network_virtual_appliances: NetworkVirtualAppliancesOperations operations + :vartype network_virtual_appliances: azure.mgmt.network.v2020_06_01.operations.NetworkVirtualAppliancesOperations + :ivar virtual_appliance_sites: VirtualApplianceSitesOperations operations + :vartype virtual_appliance_sites: azure.mgmt.network.v2020_06_01.operations.VirtualApplianceSitesOperations + :ivar virtual_appliance_skus: VirtualApplianceSkusOperations operations + :vartype virtual_appliance_skus: azure.mgmt.network.v2020_06_01.operations.VirtualApplianceSkusOperations + :ivar inbound_security_rule: InboundSecurityRuleOperations operations + :vartype inbound_security_rule: azure.mgmt.network.v2020_06_01.operations.InboundSecurityRuleOperations + :ivar network_watchers: NetworkWatchersOperations operations + :vartype network_watchers: azure.mgmt.network.v2020_06_01.operations.NetworkWatchersOperations + :ivar packet_captures: PacketCapturesOperations operations + :vartype packet_captures: azure.mgmt.network.v2020_06_01.operations.PacketCapturesOperations + :ivar connection_monitors: ConnectionMonitorsOperations operations + :vartype connection_monitors: azure.mgmt.network.v2020_06_01.operations.ConnectionMonitorsOperations + :ivar flow_logs: FlowLogsOperations operations + :vartype flow_logs: azure.mgmt.network.v2020_06_01.operations.FlowLogsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.network.v2020_06_01.operations.Operations + :ivar private_endpoints: PrivateEndpointsOperations operations + :vartype private_endpoints: azure.mgmt.network.v2020_06_01.operations.PrivateEndpointsOperations + :ivar available_private_endpoint_types: AvailablePrivateEndpointTypesOperations operations + :vartype available_private_endpoint_types: azure.mgmt.network.v2020_06_01.operations.AvailablePrivateEndpointTypesOperations + :ivar private_dns_zone_groups: PrivateDnsZoneGroupsOperations operations + :vartype private_dns_zone_groups: azure.mgmt.network.v2020_06_01.operations.PrivateDnsZoneGroupsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: azure.mgmt.network.v2020_06_01.operations.PrivateLinkServicesOperations + :ivar public_ip_addresses: PublicIPAddressesOperations operations + :vartype public_ip_addresses: azure.mgmt.network.v2020_06_01.operations.PublicIPAddressesOperations + :ivar public_ip_prefixes: PublicIPPrefixesOperations operations + :vartype public_ip_prefixes: azure.mgmt.network.v2020_06_01.operations.PublicIPPrefixesOperations + :ivar route_filters: RouteFiltersOperations operations + :vartype route_filters: azure.mgmt.network.v2020_06_01.operations.RouteFiltersOperations + :ivar route_filter_rules: RouteFilterRulesOperations operations + :vartype route_filter_rules: azure.mgmt.network.v2020_06_01.operations.RouteFilterRulesOperations + :ivar route_tables: RouteTablesOperations operations + :vartype route_tables: azure.mgmt.network.v2020_06_01.operations.RouteTablesOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.network.v2020_06_01.operations.RoutesOperations + :ivar security_partner_providers: SecurityPartnerProvidersOperations operations + :vartype security_partner_providers: azure.mgmt.network.v2020_06_01.operations.SecurityPartnerProvidersOperations + :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations + :vartype bgp_service_communities: azure.mgmt.network.v2020_06_01.operations.BgpServiceCommunitiesOperations + :ivar service_endpoint_policies: ServiceEndpointPoliciesOperations operations + :vartype service_endpoint_policies: azure.mgmt.network.v2020_06_01.operations.ServiceEndpointPoliciesOperations + :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitionsOperations operations + :vartype service_endpoint_policy_definitions: azure.mgmt.network.v2020_06_01.operations.ServiceEndpointPolicyDefinitionsOperations + :ivar service_tags: ServiceTagsOperations operations + :vartype service_tags: azure.mgmt.network.v2020_06_01.operations.ServiceTagsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.network.v2020_06_01.operations.UsagesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: azure.mgmt.network.v2020_06_01.operations.VirtualNetworksOperations + :ivar subnets: SubnetsOperations operations + :vartype subnets: azure.mgmt.network.v2020_06_01.operations.SubnetsOperations + :ivar resource_navigation_links: ResourceNavigationLinksOperations operations + :vartype resource_navigation_links: azure.mgmt.network.v2020_06_01.operations.ResourceNavigationLinksOperations + :ivar service_association_links: ServiceAssociationLinksOperations operations + :vartype service_association_links: azure.mgmt.network.v2020_06_01.operations.ServiceAssociationLinksOperations + :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations + :vartype virtual_network_peerings: azure.mgmt.network.v2020_06_01.operations.VirtualNetworkPeeringsOperations + :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations + :vartype virtual_network_gateways: azure.mgmt.network.v2020_06_01.operations.VirtualNetworkGatewaysOperations + :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations operations + :vartype virtual_network_gateway_connections: azure.mgmt.network.v2020_06_01.operations.VirtualNetworkGatewayConnectionsOperations + :ivar local_network_gateways: LocalNetworkGatewaysOperations operations + :vartype local_network_gateways: azure.mgmt.network.v2020_06_01.operations.LocalNetworkGatewaysOperations + :ivar virtual_network_taps: VirtualNetworkTapsOperations operations + :vartype virtual_network_taps: azure.mgmt.network.v2020_06_01.operations.VirtualNetworkTapsOperations + :ivar virtual_routers: VirtualRoutersOperations operations + :vartype virtual_routers: azure.mgmt.network.v2020_06_01.operations.VirtualRoutersOperations + :ivar virtual_router_peerings: VirtualRouterPeeringsOperations operations + :vartype virtual_router_peerings: azure.mgmt.network.v2020_06_01.operations.VirtualRouterPeeringsOperations + :ivar virtual_wans: VirtualWansOperations operations + :vartype virtual_wans: azure.mgmt.network.v2020_06_01.operations.VirtualWansOperations + :ivar vpn_sites: VpnSitesOperations operations + :vartype vpn_sites: azure.mgmt.network.v2020_06_01.operations.VpnSitesOperations + :ivar vpn_site_links: VpnSiteLinksOperations operations + :vartype vpn_site_links: azure.mgmt.network.v2020_06_01.operations.VpnSiteLinksOperations + :ivar vpn_sites_configuration: VpnSitesConfigurationOperations operations + :vartype vpn_sites_configuration: azure.mgmt.network.v2020_06_01.operations.VpnSitesConfigurationOperations + :ivar vpn_server_configurations: VpnServerConfigurationsOperations operations + :vartype vpn_server_configurations: azure.mgmt.network.v2020_06_01.operations.VpnServerConfigurationsOperations + :ivar virtual_hubs: VirtualHubsOperations operations + :vartype virtual_hubs: azure.mgmt.network.v2020_06_01.operations.VirtualHubsOperations + :ivar hub_virtual_network_connections: HubVirtualNetworkConnectionsOperations operations + :vartype hub_virtual_network_connections: azure.mgmt.network.v2020_06_01.operations.HubVirtualNetworkConnectionsOperations + :ivar vpn_gateways: VpnGatewaysOperations operations + :vartype vpn_gateways: azure.mgmt.network.v2020_06_01.operations.VpnGatewaysOperations + :ivar vpn_connections: VpnConnectionsOperations operations + :vartype vpn_connections: azure.mgmt.network.v2020_06_01.operations.VpnConnectionsOperations + :ivar vpn_site_link_connections: VpnSiteLinkConnectionsOperations operations + :vartype vpn_site_link_connections: azure.mgmt.network.v2020_06_01.operations.VpnSiteLinkConnectionsOperations + :ivar vpn_link_connections: VpnLinkConnectionsOperations operations + :vartype vpn_link_connections: azure.mgmt.network.v2020_06_01.operations.VpnLinkConnectionsOperations + :ivar p2_svpn_gateways: P2SVpnGatewaysOperations operations + :vartype p2_svpn_gateways: azure.mgmt.network.v2020_06_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_06_01.operations.VpnServerConfigurationsAssociatedWithVirtualWanOperations + :ivar virtual_hub_route_table_v2_s: VirtualHubRouteTableV2SOperations operations + :vartype virtual_hub_route_table_v2_s: azure.mgmt.network.v2020_06_01.operations.VirtualHubRouteTableV2SOperations + :ivar express_route_gateways: ExpressRouteGatewaysOperations operations + :vartype express_route_gateways: azure.mgmt.network.v2020_06_01.operations.ExpressRouteGatewaysOperations + :ivar express_route_connections: ExpressRouteConnectionsOperations operations + :vartype express_route_connections: azure.mgmt.network.v2020_06_01.operations.ExpressRouteConnectionsOperations + :ivar virtual_hub_bgp_connection: VirtualHubBgpConnectionOperations operations + :vartype virtual_hub_bgp_connection: azure.mgmt.network.v2020_06_01.operations.VirtualHubBgpConnectionOperations + :ivar virtual_hub_bgp_connections: VirtualHubBgpConnectionsOperations operations + :vartype virtual_hub_bgp_connections: azure.mgmt.network.v2020_06_01.operations.VirtualHubBgpConnectionsOperations + :ivar virtual_hub_ip_configuration: VirtualHubIpConfigurationOperations operations + :vartype virtual_hub_ip_configuration: azure.mgmt.network.v2020_06_01.operations.VirtualHubIpConfigurationOperations + :ivar hub_route_tables: HubRouteTablesOperations operations + :vartype hub_route_tables: azure.mgmt.network.v2020_06_01.operations.HubRouteTablesOperations + :ivar web_application_firewall_policies: WebApplicationFirewallPoliciesOperations operations + :vartype web_application_firewall_policies: azure.mgmt.network.v2020_06_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.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_06_01/aio/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/__init__.py new file mode 100644 index 000000000000..4ea3e127918e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_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_async import NetworkManagementClient +__all__ = ['NetworkManagementClient'] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_configuration_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_configuration_async.py new file mode 100644 index 000000000000..65df074fa469 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_configuration_async.py @@ -0,0 +1,64 @@ +# 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 + +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 = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + 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.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_06_01/aio/_network_management_client_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_network_management_client_async.py new file mode 100644 index 000000000000..f84dbb20e290 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/_network_management_client_async.py @@ -0,0 +1,579 @@ +# 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_async import NetworkManagementClientConfiguration +from .operations_async import ApplicationGatewaysOperations +from .operations_async import ApplicationGatewayPrivateLinkResourcesOperations +from .operations_async import ApplicationGatewayPrivateEndpointConnectionsOperations +from .operations_async import ApplicationSecurityGroupsOperations +from .operations_async import AvailableDelegationsOperations +from .operations_async import AvailableResourceGroupDelegationsOperations +from .operations_async import AvailableServiceAliasesOperations +from .operations_async import AzureFirewallsOperations +from .operations_async import AzureFirewallFqdnTagsOperations +from .operations_async import BastionHostsOperations +from .operations_async import NetworkManagementClientOperationsMixin +from .operations_async import CustomIPPrefixesOperations +from .operations_async import DdosCustomPoliciesOperations +from .operations_async import DdosProtectionPlansOperations +from .operations_async import DscpConfigurationOperations +from .operations_async import AvailableEndpointServicesOperations +from .operations_async import ExpressRouteCircuitAuthorizationsOperations +from .operations_async import ExpressRouteCircuitPeeringsOperations +from .operations_async import ExpressRouteCircuitConnectionsOperations +from .operations_async import PeerExpressRouteCircuitConnectionsOperations +from .operations_async import ExpressRouteCircuitsOperations +from .operations_async import ExpressRouteServiceProvidersOperations +from .operations_async import ExpressRouteCrossConnectionsOperations +from .operations_async import ExpressRouteCrossConnectionPeeringsOperations +from .operations_async import ExpressRoutePortsLocationsOperations +from .operations_async import ExpressRoutePortsOperations +from .operations_async import ExpressRouteLinksOperations +from .operations_async import FirewallPoliciesOperations +from .operations_async import FirewallPolicyRuleCollectionGroupsOperations +from .operations_async import IpAllocationsOperations +from .operations_async import IpGroupsOperations +from .operations_async import LoadBalancersOperations +from .operations_async import LoadBalancerBackendAddressPoolsOperations +from .operations_async import LoadBalancerFrontendIPConfigurationsOperations +from .operations_async import InboundNatRulesOperations +from .operations_async import LoadBalancerLoadBalancingRulesOperations +from .operations_async import LoadBalancerOutboundRulesOperations +from .operations_async import LoadBalancerNetworkInterfacesOperations +from .operations_async import LoadBalancerProbesOperations +from .operations_async import NatGatewaysOperations +from .operations_async import NetworkInterfacesOperations +from .operations_async import NetworkInterfaceIPConfigurationsOperations +from .operations_async import NetworkInterfaceLoadBalancersOperations +from .operations_async import NetworkInterfaceTapConfigurationsOperations +from .operations_async import NetworkProfilesOperations +from .operations_async import NetworkSecurityGroupsOperations +from .operations_async import SecurityRulesOperations +from .operations_async import DefaultSecurityRulesOperations +from .operations_async import NetworkVirtualAppliancesOperations +from .operations_async import VirtualApplianceSitesOperations +from .operations_async import VirtualApplianceSkusOperations +from .operations_async import InboundSecurityRuleOperations +from .operations_async import NetworkWatchersOperations +from .operations_async import PacketCapturesOperations +from .operations_async import ConnectionMonitorsOperations +from .operations_async import FlowLogsOperations +from .operations_async import Operations +from .operations_async import PrivateEndpointsOperations +from .operations_async import AvailablePrivateEndpointTypesOperations +from .operations_async import PrivateDnsZoneGroupsOperations +from .operations_async import PrivateLinkServicesOperations +from .operations_async import PublicIPAddressesOperations +from .operations_async import PublicIPPrefixesOperations +from .operations_async import RouteFiltersOperations +from .operations_async import RouteFilterRulesOperations +from .operations_async import RouteTablesOperations +from .operations_async import RoutesOperations +from .operations_async import SecurityPartnerProvidersOperations +from .operations_async import BgpServiceCommunitiesOperations +from .operations_async import ServiceEndpointPoliciesOperations +from .operations_async import ServiceEndpointPolicyDefinitionsOperations +from .operations_async import ServiceTagsOperations +from .operations_async import UsagesOperations +from .operations_async import VirtualNetworksOperations +from .operations_async import SubnetsOperations +from .operations_async import ResourceNavigationLinksOperations +from .operations_async import ServiceAssociationLinksOperations +from .operations_async import VirtualNetworkPeeringsOperations +from .operations_async import VirtualNetworkGatewaysOperations +from .operations_async import VirtualNetworkGatewayConnectionsOperations +from .operations_async import LocalNetworkGatewaysOperations +from .operations_async import VirtualNetworkTapsOperations +from .operations_async import VirtualRoutersOperations +from .operations_async import VirtualRouterPeeringsOperations +from .operations_async import VirtualWansOperations +from .operations_async import VpnSitesOperations +from .operations_async import VpnSiteLinksOperations +from .operations_async import VpnSitesConfigurationOperations +from .operations_async import VpnServerConfigurationsOperations +from .operations_async import VirtualHubsOperations +from .operations_async import HubVirtualNetworkConnectionsOperations +from .operations_async import VpnGatewaysOperations +from .operations_async import VpnConnectionsOperations +from .operations_async import VpnSiteLinkConnectionsOperations +from .operations_async import VpnLinkConnectionsOperations +from .operations_async import P2SVpnGatewaysOperations +from .operations_async import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from .operations_async import VirtualHubRouteTableV2SOperations +from .operations_async import ExpressRouteGatewaysOperations +from .operations_async import ExpressRouteConnectionsOperations +from .operations_async import VirtualHubBgpConnectionOperations +from .operations_async import VirtualHubBgpConnectionsOperations +from .operations_async import VirtualHubIpConfigurationOperations +from .operations_async import HubRouteTablesOperations +from .operations_async import WebApplicationFirewallPoliciesOperations +from .. import models + + +class NetworkManagementClient(NetworkManagementClientOperationsMixin): + """Network Client. + + :ivar application_gateways: ApplicationGatewaysOperations operations + :vartype application_gateways: azure.mgmt.network.v2020_06_01.aio.operations_async.ApplicationGatewaysOperations + :ivar application_gateway_private_link_resources: ApplicationGatewayPrivateLinkResourcesOperations operations + :vartype application_gateway_private_link_resources: azure.mgmt.network.v2020_06_01.aio.operations_async.ApplicationGatewayPrivateLinkResourcesOperations + :ivar application_gateway_private_endpoint_connections: ApplicationGatewayPrivateEndpointConnectionsOperations operations + :vartype application_gateway_private_endpoint_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.ApplicationGatewayPrivateEndpointConnectionsOperations + :ivar application_security_groups: ApplicationSecurityGroupsOperations operations + :vartype application_security_groups: azure.mgmt.network.v2020_06_01.aio.operations_async.ApplicationSecurityGroupsOperations + :ivar available_delegations: AvailableDelegationsOperations operations + :vartype available_delegations: azure.mgmt.network.v2020_06_01.aio.operations_async.AvailableDelegationsOperations + :ivar available_resource_group_delegations: AvailableResourceGroupDelegationsOperations operations + :vartype available_resource_group_delegations: azure.mgmt.network.v2020_06_01.aio.operations_async.AvailableResourceGroupDelegationsOperations + :ivar available_service_aliases: AvailableServiceAliasesOperations operations + :vartype available_service_aliases: azure.mgmt.network.v2020_06_01.aio.operations_async.AvailableServiceAliasesOperations + :ivar azure_firewalls: AzureFirewallsOperations operations + :vartype azure_firewalls: azure.mgmt.network.v2020_06_01.aio.operations_async.AzureFirewallsOperations + :ivar azure_firewall_fqdn_tags: AzureFirewallFqdnTagsOperations operations + :vartype azure_firewall_fqdn_tags: azure.mgmt.network.v2020_06_01.aio.operations_async.AzureFirewallFqdnTagsOperations + :ivar bastion_hosts: BastionHostsOperations operations + :vartype bastion_hosts: azure.mgmt.network.v2020_06_01.aio.operations_async.BastionHostsOperations + :ivar custom_ip_prefixes: CustomIPPrefixesOperations operations + :vartype custom_ip_prefixes: azure.mgmt.network.v2020_06_01.aio.operations_async.CustomIPPrefixesOperations + :ivar ddos_custom_policies: DdosCustomPoliciesOperations operations + :vartype ddos_custom_policies: azure.mgmt.network.v2020_06_01.aio.operations_async.DdosCustomPoliciesOperations + :ivar ddos_protection_plans: DdosProtectionPlansOperations operations + :vartype ddos_protection_plans: azure.mgmt.network.v2020_06_01.aio.operations_async.DdosProtectionPlansOperations + :ivar dscp_configuration: DscpConfigurationOperations operations + :vartype dscp_configuration: azure.mgmt.network.v2020_06_01.aio.operations_async.DscpConfigurationOperations + :ivar available_endpoint_services: AvailableEndpointServicesOperations operations + :vartype available_endpoint_services: azure.mgmt.network.v2020_06_01.aio.operations_async.AvailableEndpointServicesOperations + :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations operations + :vartype express_route_circuit_authorizations: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteCircuitAuthorizationsOperations + :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations + :vartype express_route_circuit_peerings: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteCircuitPeeringsOperations + :ivar express_route_circuit_connections: ExpressRouteCircuitConnectionsOperations operations + :vartype express_route_circuit_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteCircuitConnectionsOperations + :ivar peer_express_route_circuit_connections: PeerExpressRouteCircuitConnectionsOperations operations + :vartype peer_express_route_circuit_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.PeerExpressRouteCircuitConnectionsOperations + :ivar express_route_circuits: ExpressRouteCircuitsOperations operations + :vartype express_route_circuits: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteCircuitsOperations + :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations + :vartype express_route_service_providers: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteServiceProvidersOperations + :ivar express_route_cross_connections: ExpressRouteCrossConnectionsOperations operations + :vartype express_route_cross_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteCrossConnectionsOperations + :ivar express_route_cross_connection_peerings: ExpressRouteCrossConnectionPeeringsOperations operations + :vartype express_route_cross_connection_peerings: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteCrossConnectionPeeringsOperations + :ivar express_route_ports_locations: ExpressRoutePortsLocationsOperations operations + :vartype express_route_ports_locations: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRoutePortsLocationsOperations + :ivar express_route_ports: ExpressRoutePortsOperations operations + :vartype express_route_ports: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRoutePortsOperations + :ivar express_route_links: ExpressRouteLinksOperations operations + :vartype express_route_links: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteLinksOperations + :ivar firewall_policies: FirewallPoliciesOperations operations + :vartype firewall_policies: azure.mgmt.network.v2020_06_01.aio.operations_async.FirewallPoliciesOperations + :ivar firewall_policy_rule_collection_groups: FirewallPolicyRuleCollectionGroupsOperations operations + :vartype firewall_policy_rule_collection_groups: azure.mgmt.network.v2020_06_01.aio.operations_async.FirewallPolicyRuleCollectionGroupsOperations + :ivar ip_allocations: IpAllocationsOperations operations + :vartype ip_allocations: azure.mgmt.network.v2020_06_01.aio.operations_async.IpAllocationsOperations + :ivar ip_groups: IpGroupsOperations operations + :vartype ip_groups: azure.mgmt.network.v2020_06_01.aio.operations_async.IpGroupsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: azure.mgmt.network.v2020_06_01.aio.operations_async.LoadBalancersOperations + :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations + :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2020_06_01.aio.operations_async.LoadBalancerBackendAddressPoolsOperations + :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations operations + :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2020_06_01.aio.operations_async.LoadBalancerFrontendIPConfigurationsOperations + :ivar inbound_nat_rules: InboundNatRulesOperations operations + :vartype inbound_nat_rules: azure.mgmt.network.v2020_06_01.aio.operations_async.InboundNatRulesOperations + :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations + :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2020_06_01.aio.operations_async.LoadBalancerLoadBalancingRulesOperations + :ivar load_balancer_outbound_rules: LoadBalancerOutboundRulesOperations operations + :vartype load_balancer_outbound_rules: azure.mgmt.network.v2020_06_01.aio.operations_async.LoadBalancerOutboundRulesOperations + :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations + :vartype load_balancer_network_interfaces: azure.mgmt.network.v2020_06_01.aio.operations_async.LoadBalancerNetworkInterfacesOperations + :ivar load_balancer_probes: LoadBalancerProbesOperations operations + :vartype load_balancer_probes: azure.mgmt.network.v2020_06_01.aio.operations_async.LoadBalancerProbesOperations + :ivar nat_gateways: NatGatewaysOperations operations + :vartype nat_gateways: azure.mgmt.network.v2020_06_01.aio.operations_async.NatGatewaysOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: azure.mgmt.network.v2020_06_01.aio.operations_async.NetworkInterfacesOperations + :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations operations + :vartype network_interface_ip_configurations: azure.mgmt.network.v2020_06_01.aio.operations_async.NetworkInterfaceIPConfigurationsOperations + :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations + :vartype network_interface_load_balancers: azure.mgmt.network.v2020_06_01.aio.operations_async.NetworkInterfaceLoadBalancersOperations + :ivar network_interface_tap_configurations: NetworkInterfaceTapConfigurationsOperations operations + :vartype network_interface_tap_configurations: azure.mgmt.network.v2020_06_01.aio.operations_async.NetworkInterfaceTapConfigurationsOperations + :ivar network_profiles: NetworkProfilesOperations operations + :vartype network_profiles: azure.mgmt.network.v2020_06_01.aio.operations_async.NetworkProfilesOperations + :ivar network_security_groups: NetworkSecurityGroupsOperations operations + :vartype network_security_groups: azure.mgmt.network.v2020_06_01.aio.operations_async.NetworkSecurityGroupsOperations + :ivar security_rules: SecurityRulesOperations operations + :vartype security_rules: azure.mgmt.network.v2020_06_01.aio.operations_async.SecurityRulesOperations + :ivar default_security_rules: DefaultSecurityRulesOperations operations + :vartype default_security_rules: azure.mgmt.network.v2020_06_01.aio.operations_async.DefaultSecurityRulesOperations + :ivar network_virtual_appliances: NetworkVirtualAppliancesOperations operations + :vartype network_virtual_appliances: azure.mgmt.network.v2020_06_01.aio.operations_async.NetworkVirtualAppliancesOperations + :ivar virtual_appliance_sites: VirtualApplianceSitesOperations operations + :vartype virtual_appliance_sites: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualApplianceSitesOperations + :ivar virtual_appliance_skus: VirtualApplianceSkusOperations operations + :vartype virtual_appliance_skus: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualApplianceSkusOperations + :ivar inbound_security_rule: InboundSecurityRuleOperations operations + :vartype inbound_security_rule: azure.mgmt.network.v2020_06_01.aio.operations_async.InboundSecurityRuleOperations + :ivar network_watchers: NetworkWatchersOperations operations + :vartype network_watchers: azure.mgmt.network.v2020_06_01.aio.operations_async.NetworkWatchersOperations + :ivar packet_captures: PacketCapturesOperations operations + :vartype packet_captures: azure.mgmt.network.v2020_06_01.aio.operations_async.PacketCapturesOperations + :ivar connection_monitors: ConnectionMonitorsOperations operations + :vartype connection_monitors: azure.mgmt.network.v2020_06_01.aio.operations_async.ConnectionMonitorsOperations + :ivar flow_logs: FlowLogsOperations operations + :vartype flow_logs: azure.mgmt.network.v2020_06_01.aio.operations_async.FlowLogsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.network.v2020_06_01.aio.operations_async.Operations + :ivar private_endpoints: PrivateEndpointsOperations operations + :vartype private_endpoints: azure.mgmt.network.v2020_06_01.aio.operations_async.PrivateEndpointsOperations + :ivar available_private_endpoint_types: AvailablePrivateEndpointTypesOperations operations + :vartype available_private_endpoint_types: azure.mgmt.network.v2020_06_01.aio.operations_async.AvailablePrivateEndpointTypesOperations + :ivar private_dns_zone_groups: PrivateDnsZoneGroupsOperations operations + :vartype private_dns_zone_groups: azure.mgmt.network.v2020_06_01.aio.operations_async.PrivateDnsZoneGroupsOperations + :ivar private_link_services: PrivateLinkServicesOperations operations + :vartype private_link_services: azure.mgmt.network.v2020_06_01.aio.operations_async.PrivateLinkServicesOperations + :ivar public_ip_addresses: PublicIPAddressesOperations operations + :vartype public_ip_addresses: azure.mgmt.network.v2020_06_01.aio.operations_async.PublicIPAddressesOperations + :ivar public_ip_prefixes: PublicIPPrefixesOperations operations + :vartype public_ip_prefixes: azure.mgmt.network.v2020_06_01.aio.operations_async.PublicIPPrefixesOperations + :ivar route_filters: RouteFiltersOperations operations + :vartype route_filters: azure.mgmt.network.v2020_06_01.aio.operations_async.RouteFiltersOperations + :ivar route_filter_rules: RouteFilterRulesOperations operations + :vartype route_filter_rules: azure.mgmt.network.v2020_06_01.aio.operations_async.RouteFilterRulesOperations + :ivar route_tables: RouteTablesOperations operations + :vartype route_tables: azure.mgmt.network.v2020_06_01.aio.operations_async.RouteTablesOperations + :ivar routes: RoutesOperations operations + :vartype routes: azure.mgmt.network.v2020_06_01.aio.operations_async.RoutesOperations + :ivar security_partner_providers: SecurityPartnerProvidersOperations operations + :vartype security_partner_providers: azure.mgmt.network.v2020_06_01.aio.operations_async.SecurityPartnerProvidersOperations + :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations + :vartype bgp_service_communities: azure.mgmt.network.v2020_06_01.aio.operations_async.BgpServiceCommunitiesOperations + :ivar service_endpoint_policies: ServiceEndpointPoliciesOperations operations + :vartype service_endpoint_policies: azure.mgmt.network.v2020_06_01.aio.operations_async.ServiceEndpointPoliciesOperations + :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitionsOperations operations + :vartype service_endpoint_policy_definitions: azure.mgmt.network.v2020_06_01.aio.operations_async.ServiceEndpointPolicyDefinitionsOperations + :ivar service_tags: ServiceTagsOperations operations + :vartype service_tags: azure.mgmt.network.v2020_06_01.aio.operations_async.ServiceTagsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.network.v2020_06_01.aio.operations_async.UsagesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualNetworksOperations + :ivar subnets: SubnetsOperations operations + :vartype subnets: azure.mgmt.network.v2020_06_01.aio.operations_async.SubnetsOperations + :ivar resource_navigation_links: ResourceNavigationLinksOperations operations + :vartype resource_navigation_links: azure.mgmt.network.v2020_06_01.aio.operations_async.ResourceNavigationLinksOperations + :ivar service_association_links: ServiceAssociationLinksOperations operations + :vartype service_association_links: azure.mgmt.network.v2020_06_01.aio.operations_async.ServiceAssociationLinksOperations + :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations + :vartype virtual_network_peerings: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualNetworkPeeringsOperations + :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations + :vartype virtual_network_gateways: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualNetworkGatewaysOperations + :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations operations + :vartype virtual_network_gateway_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualNetworkGatewayConnectionsOperations + :ivar local_network_gateways: LocalNetworkGatewaysOperations operations + :vartype local_network_gateways: azure.mgmt.network.v2020_06_01.aio.operations_async.LocalNetworkGatewaysOperations + :ivar virtual_network_taps: VirtualNetworkTapsOperations operations + :vartype virtual_network_taps: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualNetworkTapsOperations + :ivar virtual_routers: VirtualRoutersOperations operations + :vartype virtual_routers: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualRoutersOperations + :ivar virtual_router_peerings: VirtualRouterPeeringsOperations operations + :vartype virtual_router_peerings: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualRouterPeeringsOperations + :ivar virtual_wans: VirtualWansOperations operations + :vartype virtual_wans: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualWansOperations + :ivar vpn_sites: VpnSitesOperations operations + :vartype vpn_sites: azure.mgmt.network.v2020_06_01.aio.operations_async.VpnSitesOperations + :ivar vpn_site_links: VpnSiteLinksOperations operations + :vartype vpn_site_links: azure.mgmt.network.v2020_06_01.aio.operations_async.VpnSiteLinksOperations + :ivar vpn_sites_configuration: VpnSitesConfigurationOperations operations + :vartype vpn_sites_configuration: azure.mgmt.network.v2020_06_01.aio.operations_async.VpnSitesConfigurationOperations + :ivar vpn_server_configurations: VpnServerConfigurationsOperations operations + :vartype vpn_server_configurations: azure.mgmt.network.v2020_06_01.aio.operations_async.VpnServerConfigurationsOperations + :ivar virtual_hubs: VirtualHubsOperations operations + :vartype virtual_hubs: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualHubsOperations + :ivar hub_virtual_network_connections: HubVirtualNetworkConnectionsOperations operations + :vartype hub_virtual_network_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.HubVirtualNetworkConnectionsOperations + :ivar vpn_gateways: VpnGatewaysOperations operations + :vartype vpn_gateways: azure.mgmt.network.v2020_06_01.aio.operations_async.VpnGatewaysOperations + :ivar vpn_connections: VpnConnectionsOperations operations + :vartype vpn_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.VpnConnectionsOperations + :ivar vpn_site_link_connections: VpnSiteLinkConnectionsOperations operations + :vartype vpn_site_link_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.VpnSiteLinkConnectionsOperations + :ivar vpn_link_connections: VpnLinkConnectionsOperations operations + :vartype vpn_link_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.VpnLinkConnectionsOperations + :ivar p2_svpn_gateways: P2SVpnGatewaysOperations operations + :vartype p2_svpn_gateways: azure.mgmt.network.v2020_06_01.aio.operations_async.P2SVpnGatewaysOperations + :ivar vpn_server_configurations_associated_with_virtual_wan: VpnServerConfigurationsAssociatedWithVirtualWanOperations operations + :vartype vpn_server_configurations_associated_with_virtual_wan: azure.mgmt.network.v2020_06_01.aio.operations_async.VpnServerConfigurationsAssociatedWithVirtualWanOperations + :ivar virtual_hub_route_table_v2_s: VirtualHubRouteTableV2SOperations operations + :vartype virtual_hub_route_table_v2_s: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualHubRouteTableV2SOperations + :ivar express_route_gateways: ExpressRouteGatewaysOperations operations + :vartype express_route_gateways: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteGatewaysOperations + :ivar express_route_connections: ExpressRouteConnectionsOperations operations + :vartype express_route_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.ExpressRouteConnectionsOperations + :ivar virtual_hub_bgp_connection: VirtualHubBgpConnectionOperations operations + :vartype virtual_hub_bgp_connection: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualHubBgpConnectionOperations + :ivar virtual_hub_bgp_connections: VirtualHubBgpConnectionsOperations operations + :vartype virtual_hub_bgp_connections: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualHubBgpConnectionsOperations + :ivar virtual_hub_ip_configuration: VirtualHubIpConfigurationOperations operations + :vartype virtual_hub_ip_configuration: azure.mgmt.network.v2020_06_01.aio.operations_async.VirtualHubIpConfigurationOperations + :ivar hub_route_tables: HubRouteTablesOperations operations + :vartype hub_route_tables: azure.mgmt.network.v2020_06_01.aio.operations_async.HubRouteTablesOperations + :ivar web_application_firewall_policies: WebApplicationFirewallPoliciesOperations operations + :vartype web_application_firewall_policies: azure.mgmt.network.v2020_06_01.aio.operations_async.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.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_06_01/aio/operations_async/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/__init__.py new file mode 100644 index 000000000000..4d0d767a0178 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/__init__.py @@ -0,0 +1,221 @@ +# 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_async import ApplicationGatewaysOperations +from ._application_gateway_private_link_resources_operations_async import ApplicationGatewayPrivateLinkResourcesOperations +from ._application_gateway_private_endpoint_connections_operations_async import ApplicationGatewayPrivateEndpointConnectionsOperations +from ._application_security_groups_operations_async import ApplicationSecurityGroupsOperations +from ._available_delegations_operations_async import AvailableDelegationsOperations +from ._available_resource_group_delegations_operations_async import AvailableResourceGroupDelegationsOperations +from ._available_service_aliases_operations_async import AvailableServiceAliasesOperations +from ._azure_firewalls_operations_async import AzureFirewallsOperations +from ._azure_firewall_fqdn_tags_operations_async import AzureFirewallFqdnTagsOperations +from ._bastion_hosts_operations_async import BastionHostsOperations +from ._network_management_client_operations_async import NetworkManagementClientOperationsMixin +from ._custom_ip_prefixes_operations_async import CustomIPPrefixesOperations +from ._ddos_custom_policies_operations_async import DdosCustomPoliciesOperations +from ._ddos_protection_plans_operations_async import DdosProtectionPlansOperations +from ._dscp_configuration_operations_async import DscpConfigurationOperations +from ._available_endpoint_services_operations_async import AvailableEndpointServicesOperations +from ._express_route_circuit_authorizations_operations_async import ExpressRouteCircuitAuthorizationsOperations +from ._express_route_circuit_peerings_operations_async import ExpressRouteCircuitPeeringsOperations +from ._express_route_circuit_connections_operations_async import ExpressRouteCircuitConnectionsOperations +from ._peer_express_route_circuit_connections_operations_async import PeerExpressRouteCircuitConnectionsOperations +from ._express_route_circuits_operations_async import ExpressRouteCircuitsOperations +from ._express_route_service_providers_operations_async import ExpressRouteServiceProvidersOperations +from ._express_route_cross_connections_operations_async import ExpressRouteCrossConnectionsOperations +from ._express_route_cross_connection_peerings_operations_async import ExpressRouteCrossConnectionPeeringsOperations +from ._express_route_ports_locations_operations_async import ExpressRoutePortsLocationsOperations +from ._express_route_ports_operations_async import ExpressRoutePortsOperations +from ._express_route_links_operations_async import ExpressRouteLinksOperations +from ._firewall_policies_operations_async import FirewallPoliciesOperations +from ._firewall_policy_rule_collection_groups_operations_async import FirewallPolicyRuleCollectionGroupsOperations +from ._ip_allocations_operations_async import IpAllocationsOperations +from ._ip_groups_operations_async import IpGroupsOperations +from ._load_balancers_operations_async import LoadBalancersOperations +from ._load_balancer_backend_address_pools_operations_async import LoadBalancerBackendAddressPoolsOperations +from ._load_balancer_frontend_ip_configurations_operations_async import LoadBalancerFrontendIPConfigurationsOperations +from ._inbound_nat_rules_operations_async import InboundNatRulesOperations +from ._load_balancer_load_balancing_rules_operations_async import LoadBalancerLoadBalancingRulesOperations +from ._load_balancer_outbound_rules_operations_async import LoadBalancerOutboundRulesOperations +from ._load_balancer_network_interfaces_operations_async import LoadBalancerNetworkInterfacesOperations +from ._load_balancer_probes_operations_async import LoadBalancerProbesOperations +from ._nat_gateways_operations_async import NatGatewaysOperations +from ._network_interfaces_operations_async import NetworkInterfacesOperations +from ._network_interface_ip_configurations_operations_async import NetworkInterfaceIPConfigurationsOperations +from ._network_interface_load_balancers_operations_async import NetworkInterfaceLoadBalancersOperations +from ._network_interface_tap_configurations_operations_async import NetworkInterfaceTapConfigurationsOperations +from ._network_profiles_operations_async import NetworkProfilesOperations +from ._network_security_groups_operations_async import NetworkSecurityGroupsOperations +from ._security_rules_operations_async import SecurityRulesOperations +from ._default_security_rules_operations_async import DefaultSecurityRulesOperations +from ._network_virtual_appliances_operations_async import NetworkVirtualAppliancesOperations +from ._virtual_appliance_sites_operations_async import VirtualApplianceSitesOperations +from ._virtual_appliance_skus_operations_async import VirtualApplianceSkusOperations +from ._inbound_security_rule_operations_async import InboundSecurityRuleOperations +from ._network_watchers_operations_async import NetworkWatchersOperations +from ._packet_captures_operations_async import PacketCapturesOperations +from ._connection_monitors_operations_async import ConnectionMonitorsOperations +from ._flow_logs_operations_async import FlowLogsOperations +from ._operations_async import Operations +from ._private_endpoints_operations_async import PrivateEndpointsOperations +from ._available_private_endpoint_types_operations_async import AvailablePrivateEndpointTypesOperations +from ._private_dns_zone_groups_operations_async import PrivateDnsZoneGroupsOperations +from ._private_link_services_operations_async import PrivateLinkServicesOperations +from ._public_ip_addresses_operations_async import PublicIPAddressesOperations +from ._public_ip_prefixes_operations_async import PublicIPPrefixesOperations +from ._route_filters_operations_async import RouteFiltersOperations +from ._route_filter_rules_operations_async import RouteFilterRulesOperations +from ._route_tables_operations_async import RouteTablesOperations +from ._routes_operations_async import RoutesOperations +from ._security_partner_providers_operations_async import SecurityPartnerProvidersOperations +from ._bgp_service_communities_operations_async import BgpServiceCommunitiesOperations +from ._service_endpoint_policies_operations_async import ServiceEndpointPoliciesOperations +from ._service_endpoint_policy_definitions_operations_async import ServiceEndpointPolicyDefinitionsOperations +from ._service_tags_operations_async import ServiceTagsOperations +from ._usages_operations_async import UsagesOperations +from ._virtual_networks_operations_async import VirtualNetworksOperations +from ._subnets_operations_async import SubnetsOperations +from ._resource_navigation_links_operations_async import ResourceNavigationLinksOperations +from ._service_association_links_operations_async import ServiceAssociationLinksOperations +from ._virtual_network_peerings_operations_async import VirtualNetworkPeeringsOperations +from ._virtual_network_gateways_operations_async import VirtualNetworkGatewaysOperations +from ._virtual_network_gateway_connections_operations_async import VirtualNetworkGatewayConnectionsOperations +from ._local_network_gateways_operations_async import LocalNetworkGatewaysOperations +from ._virtual_network_taps_operations_async import VirtualNetworkTapsOperations +from ._virtual_routers_operations_async import VirtualRoutersOperations +from ._virtual_router_peerings_operations_async import VirtualRouterPeeringsOperations +from ._virtual_wans_operations_async import VirtualWansOperations +from ._vpn_sites_operations_async import VpnSitesOperations +from ._vpn_site_links_operations_async import VpnSiteLinksOperations +from ._vpn_sites_configuration_operations_async import VpnSitesConfigurationOperations +from ._vpn_server_configurations_operations_async import VpnServerConfigurationsOperations +from ._virtual_hubs_operations_async import VirtualHubsOperations +from ._hub_virtual_network_connections_operations_async import HubVirtualNetworkConnectionsOperations +from ._vpn_gateways_operations_async import VpnGatewaysOperations +from ._vpn_connections_operations_async import VpnConnectionsOperations +from ._vpn_site_link_connections_operations_async import VpnSiteLinkConnectionsOperations +from ._vpn_link_connections_operations_async import VpnLinkConnectionsOperations +from ._p2_svpn_gateways_operations_async import P2SVpnGatewaysOperations +from ._vpn_server_configurations_associated_with_virtual_wan_operations_async import VpnServerConfigurationsAssociatedWithVirtualWanOperations +from ._virtual_hub_route_table_v2_s_operations_async import VirtualHubRouteTableV2SOperations +from ._express_route_gateways_operations_async import ExpressRouteGatewaysOperations +from ._express_route_connections_operations_async import ExpressRouteConnectionsOperations +from ._virtual_hub_bgp_connection_operations_async import VirtualHubBgpConnectionOperations +from ._virtual_hub_bgp_connections_operations_async import VirtualHubBgpConnectionsOperations +from ._virtual_hub_ip_configuration_operations_async import VirtualHubIpConfigurationOperations +from ._hub_route_tables_operations_async import HubRouteTablesOperations +from ._web_application_firewall_policies_operations_async import WebApplicationFirewallPoliciesOperations + +__all__ = [ + 'ApplicationGatewaysOperations', + 'ApplicationGatewayPrivateLinkResourcesOperations', + 'ApplicationGatewayPrivateEndpointConnectionsOperations', + 'ApplicationSecurityGroupsOperations', + 'AvailableDelegationsOperations', + 'AvailableResourceGroupDelegationsOperations', + 'AvailableServiceAliasesOperations', + 'AzureFirewallsOperations', + 'AzureFirewallFqdnTagsOperations', + '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_06_01/aio/operations_async/_application_gateway_private_endpoint_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_gateway_private_endpoint_connections_operations_async.py new file mode 100644 index 000000000000..2aa327790400 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_gateway_private_endpoint_connections_operations_async.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, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ApplicationGatewayPrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_application_gateway_private_link_resources_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_gateway_private_link_resources_operations_async.py new file mode 100644 index 000000000000..4099c594e639 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_gateway_private_link_resources_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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_06_01.models.ApplicationGatewayPrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateLinkResourceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_application_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_gateways_operations_async.py new file mode 100644 index 000000000000..9629408879d9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_gateways_operations_async.py @@ -0,0 +1,1299 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayAvailableSslOptions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ApplicationGatewaySslPredefinedPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_application_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_security_groups_operations_async.py new file mode 100644 index 000000000000..b4e69041b343 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_application_security_groups_operations_async.py @@ -0,0 +1,512 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_available_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_delegations_operations_async.py new file mode 100644 index 000000000000..e0df4e327c88 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_delegations_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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_06_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_available_endpoint_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_endpoint_services_operations_async.py new file mode 100644 index 000000000000..b1b7fef02b91 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_endpoint_services_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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_06_01.models.EndpointServicesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_available_private_endpoint_types_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_private_endpoint_types_operations_async.py new file mode 100644 index 000000000000..ace2b5f33609 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_private_endpoint_types_operations_async.py @@ -0,0 +1,182 @@ +# 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 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 + +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_06_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_06_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_available_resource_group_delegations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_resource_group_delegations_operations_async.py new file mode 100644 index 000000000000..855bd7b67a40 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_resource_group_delegations_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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_06_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_available_service_aliases_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_service_aliases_operations_async.py new file mode 100644 index 000000000000..4823fd793910 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_available_service_aliases_operations_async.py @@ -0,0 +1,180 @@ +# 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 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 + +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_06_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_06_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py new file mode 100644 index 000000000000..5578692f1d34 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_azure_firewall_fqdn_tags_operations_async.py @@ -0,0 +1,105 @@ +# 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 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 + +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_06_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_06_01.models.AzureFirewallFqdnTagListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_azure_firewalls_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_azure_firewalls_operations_async.py new file mode 100644 index 000000000000..0a1d9b73055c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_azure_firewalls_operations_async.py @@ -0,0 +1,565 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.AzureFirewall + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_bastion_hosts_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_bastion_hosts_operations_async.py new file mode 100644 index 000000000000..f72f1f0403b1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_bastion_hosts_operations_async.py @@ -0,0 +1,447 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.BastionHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_bgp_service_communities_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_bgp_service_communities_operations_async.py new file mode 100644 index 000000000000..0bdd5a4fce40 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_bgp_service_communities_operations_async.py @@ -0,0 +1,105 @@ +# 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 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 + +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_06_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_06_01.models.BgpServiceCommunityListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_connection_monitors_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_connection_monitors_operations_async.py new file mode 100644 index 000000000000..d7b026bba4f8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_connection_monitors_operations_async.py @@ -0,0 +1,803 @@ +# 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 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 + +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_06_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", + **kwargs + ) -> "models.ConnectionMonitorResult": + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + 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", + **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_06_01.models.ConnectionMonitor + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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_06_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, + 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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ConnectionMonitorListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_custom_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_custom_ip_prefixes_operations_async.py new file mode 100644 index 000000000000..c1a68326d3a7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_custom_ip_prefixes_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.CustomIpPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.CustomIpPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.CustomIpPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.CustomIpPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_ddos_custom_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ddos_custom_policies_operations_async.py new file mode 100644 index 000000000000..ab90e6b4507b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ddos_custom_policies_operations_async.py @@ -0,0 +1,380 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py new file mode 100644 index 000000000000..a2ab6b80b4e5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ddos_protection_plans_operations_async.py @@ -0,0 +1,511 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_default_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_default_security_rules_operations_async.py new file mode 100644 index 000000000000..ac66ed7f4461 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_default_security_rules_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_06_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_06_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_dscp_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_dscp_configuration_operations_async.py new file mode 100644 index 000000000000..74bc7b94f9d2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_dscp_configuration_operations_async.py @@ -0,0 +1,447 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.DscpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.DscpConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.DscpConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py new file mode 100644 index 000000000000..91b17c135583 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuit_authorizations_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuitAuthorization + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.AuthorizationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py new file mode 100644 index 000000000000..152049d16af9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuit_connections_operations_async.py @@ -0,0 +1,427 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py new file mode 100644 index 000000000000..7f639994d66e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuit_peerings_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuitPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ExpressRouteCircuitPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_express_route_circuits_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuits_operations_async.py new file mode 100644 index 000000000000..efbb7b4264c6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_circuits_operations_async.py @@ -0,0 +1,985 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_express_route_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_connections_operations_async.py new file mode 100644 index 000000000000..fdfbaa15252e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_connections_operations_async.py @@ -0,0 +1,388 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ExpressRouteConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteConnectionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py new file mode 100644 index 000000000000..cb5a06ea14aa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_cross_connection_peerings_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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_06_01.models.ExpressRouteCrossConnectionPeeringList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCrossConnectionPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py new file mode 100644 index 000000000000..a2a2eebc2336 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_cross_connections_operations_async.py @@ -0,0 +1,771 @@ +# 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 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 + +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_06_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_06_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_express_route_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_gateways_operations_async.py new file mode 100644 index 000000000000..a3c3ad3f586e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_gateways_operations_async.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, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ExpressRouteGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_express_route_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_links_operations_async.py new file mode 100644 index 000000000000..b046bbd25c1a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_links_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_06_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_06_01.models.ExpressRouteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ExpressRouteLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_express_route_ports_locations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_ports_locations_operations_async.py new file mode 100644 index 000000000000..f62420628c78 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_ports_locations_operations_async.py @@ -0,0 +1,159 @@ +# 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 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 + +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_06_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_06_01.models.ExpressRoutePortsLocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRoutePortsLocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_express_route_ports_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_ports_operations_async.py new file mode 100644 index 000000000000..c9af7fdc6310 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_ports_operations_async.py @@ -0,0 +1,575 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_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_06_01.models.GenerateExpressRoutePortsLOAResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.GenerateExpressRoutePortsLOAResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01/aio/operations_async/_express_route_service_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_service_providers_operations_async.py new file mode 100644 index 000000000000..493f793d9acb --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_express_route_service_providers_operations_async.py @@ -0,0 +1,105 @@ +# 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 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 + +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_06_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_06_01.models.ExpressRouteServiceProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_firewall_policies_operations_async.py new file mode 100644 index 000000000000..c005cb0f47e1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_firewall_policies_operations_async.py @@ -0,0 +1,452 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.FirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_firewall_policy_rule_collection_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_firewall_policy_rule_collection_groups_operations_async.py new file mode 100644 index 000000000000..7be76452289b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_firewall_policy_rule_collection_groups_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.FirewallPolicyRuleCollectionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.FirewallPolicyRuleCollectionGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_flow_logs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_flow_logs_operations_async.py new file mode 100644 index 000000000000..2c24bc122ab7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_flow_logs_operations_async.py @@ -0,0 +1,477 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.FlowLogListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_hub_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_hub_route_tables_operations_async.py new file mode 100644 index 000000000000..ad4e16eb1e4c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_hub_route_tables_operations_async.py @@ -0,0 +1,404 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.HubRouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListHubRouteTablesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py new file mode 100644 index 000000000000..c9b833a0b14a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_hub_virtual_network_connections_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.HubVirtualNetworkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ListHubVirtualNetworkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py new file mode 100644 index 000000000000..d1d9662be3bf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_inbound_nat_rules_operations_async.py @@ -0,0 +1,410 @@ +# 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 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 + +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_06_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_06_01.models.InboundNatRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.InboundNatRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01/aio/operations_async/_inbound_security_rule_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_inbound_security_rule_operations_async.py new file mode 100644 index 000000000000..92889c8f6ca8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_inbound_security_rule_operations_async.py @@ -0,0 +1,170 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01/aio/operations_async/_ip_allocations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ip_allocations_operations_async.py new file mode 100644 index 000000000000..fd641a1a6289 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ip_allocations_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_ip_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ip_groups_operations_async.py new file mode 100644 index 000000000000..a5139aae5224 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_ip_groups_operations_async.py @@ -0,0 +1,523 @@ +# 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 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 + +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_06_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_06_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py new file mode 100644 index 000000000000..56e21d85d1a7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_backend_address_pools_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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_06_01.models.LoadBalancerBackendAddressPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.BackendAddressPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py new file mode 100644 index 000000000000..9b14a64dfdb7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_frontend_ip_configurations_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_06_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_06_01.models.LoadBalancerFrontendIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.FrontendIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py new file mode 100644 index 000000000000..95e5f9e6b1dc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_load_balancing_rules_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_06_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_06_01.models.LoadBalancerLoadBalancingRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.LoadBalancingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.py new file mode 100644 index 000000000000..7db47573363d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_network_interfaces_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py new file mode 100644 index 000000000000..22084ad51e3a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_outbound_rules_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_06_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_06_01.models.LoadBalancerOutboundRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.OutboundRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_load_balancer_probes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_probes_operations_async.py new file mode 100644 index 000000000000..c853eb3de1eb --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancer_probes_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_06_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_06_01.models.LoadBalancerProbeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.Probe + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancers_operations_async.py new file mode 100644 index 000000000000..217a7a1356fa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_load_balancers_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_local_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_local_network_gateways_operations_async.py new file mode 100644 index 000000000000..0ef6f452378d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_local_network_gateways_operations_async.py @@ -0,0 +1,448 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.LocalNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_nat_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_nat_gateways_operations_async.py new file mode 100644 index 000000000000..289c2f704b92 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_nat_gateways_operations_async.py @@ -0,0 +1,519 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 + ) -> "models.NatGateway": + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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) + + 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, {}) + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py new file mode 100644 index 000000000000..17f4b72412c4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interface_ip_configurations_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_06_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_06_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.py new file mode 100644 index 000000000000..b4454db8d574 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interface_load_balancers_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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_06_01.models.NetworkInterfaceLoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py new file mode 100644 index 000000000000..b0418b46e940 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interface_tap_configurations_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkInterfaceTapConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.NetworkInterfaceTapConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_network_interfaces_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interfaces_operations_async.py new file mode 100644 index 000000000000..6828c2eaf5e0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_interfaces_operations_async.py @@ -0,0 +1,1101 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_06_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_network_management_client_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_management_client_operations_async.py new file mode 100644 index 000000000000..9bc34a01e21e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_management_client_operations_async.py @@ -0,0 +1,759 @@ +# 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 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 + +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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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["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_06_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 BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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): + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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["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 either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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): + deserialized = self._deserialize('BastionActiveSessionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "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'] = 'application/json' + + 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_06_01.models.DnsNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.VirtualWanSecurityProviders + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_network_profiles_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_profiles_operations_async.py new file mode 100644 index 000000000000..e5f68bc43a1c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_profiles_operations_async.py @@ -0,0 +1,464 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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_06_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_network_security_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_security_groups_operations_async.py new file mode 100644 index 000000000000..b2e241018e65 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_security_groups_operations_async.py @@ -0,0 +1,517 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_network_virtual_appliances_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_virtual_appliances_operations_async.py new file mode 100644 index 000000000000..caa25e44035c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_virtual_appliances_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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_06_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_network_watchers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_watchers_operations_async.py new file mode 100644 index 000000000000..0edac065d6bc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_network_watchers_operations_async.py @@ -0,0 +1,1870 @@ +# 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 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 + +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_06_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_06_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_06_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_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_06_01.models.Topology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_operations_async.py new file mode 100644 index 000000000000..5b129efb92ba --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_operations_async.py @@ -0,0 +1,101 @@ +# 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 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 + +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_06_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_06_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_p2_svpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_p2_svpn_gateways_operations_async.py new file mode 100644 index 000000000000..776cce661a36 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_p2_svpn_gateways_operations_async.py @@ -0,0 +1,1130 @@ +# 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 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 + +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_06_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_06_01.models.P2SVpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_packet_captures_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_packet_captures_operations_async.py new file mode 100644 index 000000000000..aa58d7fcabaf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_packet_captures_operations_async.py @@ -0,0 +1,625 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.PacketCaptureResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PacketCaptureListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py new file mode 100644 index 000000000000..caec40aa84d6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_peer_express_route_circuit_connections_operations_async.py @@ -0,0 +1,182 @@ +# 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 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 + +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_06_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_06_01.models.PeerExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.PeerExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_private_dns_zone_groups_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_private_dns_zone_groups_operations_async.py new file mode 100644 index 000000000000..b9f7182dc561 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_private_dns_zone_groups_operations_async.py @@ -0,0 +1,406 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PrivateDnsZoneGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.PrivateDnsZoneGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_private_endpoints_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_private_endpoints_operations_async.py new file mode 100644 index 000000000000..c3cf328095e3 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_private_endpoints_operations_async.py @@ -0,0 +1,457 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PrivateEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_private_link_services_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_private_link_services_operations_async.py new file mode 100644 index 000000000000..79274c851b78 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_private_link_services_operations_async.py @@ -0,0 +1,1140 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PrivateLinkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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_06_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_public_ip_addresses_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_public_ip_addresses_operations_async.py new file mode 100644 index 000000000000..4fda834e6113 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_public_ip_addresses_operations_async.py @@ -0,0 +1,747 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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 subnet. + :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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 subnet. + :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_06_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_public_ip_prefixes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_public_ip_prefixes_operations_async.py new file mode 100644 index 000000000000..7ef547fcf335 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_public_ip_prefixes_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_resource_navigation_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_resource_navigation_links_operations_async.py new file mode 100644 index 000000000000..e4e0aef99fd4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_resource_navigation_links_operations_async.py @@ -0,0 +1,100 @@ +# 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 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 + +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_06_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_06_01.models.ResourceNavigationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_route_filter_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_route_filter_rules_operations_async.py new file mode 100644 index 000000000000..3b1360b1e021 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_route_filter_rules_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.RouteFilterRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.RouteFilterRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_route_filters_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_route_filters_operations_async.py new file mode 100644 index 000000000000..9783debcd758 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_route_filters_operations_async.py @@ -0,0 +1,517 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_route_tables_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_route_tables_operations_async.py new file mode 100644 index 000000000000..bf5ad5218987 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_route_tables_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_routes_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_routes_operations_async.py new file mode 100644 index 000000000000..34f75ce77cea --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_routes_operations_async.py @@ -0,0 +1,404 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.Route + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.RouteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_security_partner_providers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_security_partner_providers_operations_async.py new file mode 100644 index 000000000000..5b5cbab04228 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_security_partner_providers_operations_async.py @@ -0,0 +1,512 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_security_rules_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_security_rules_operations_async.py new file mode 100644 index 000000000000..2c856b9e240a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_security_rules_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_service_association_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_association_links_operations_async.py new file mode 100644 index 000000000000..72db9c32393c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_association_links_operations_async.py @@ -0,0 +1,100 @@ +# 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 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 + +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_06_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_06_01.models.ServiceAssociationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_service_endpoint_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_endpoint_policies_operations_async.py new file mode 100644 index 000000000000..066fe6ed2545 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_endpoint_policies_operations_async.py @@ -0,0 +1,517 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py new file mode 100644 index 000000000000..2a48eec238bf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_endpoint_policy_definitions_operations_async.py @@ -0,0 +1,409 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ServiceEndpointPolicyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ServiceEndpointPolicyDefinitionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_service_tags_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_tags_operations_async.py new file mode 100644 index 000000000000..a6a0904d7839 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_service_tags_operations_async.py @@ -0,0 +1,94 @@ +# 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 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 + +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_06_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_06_01.models.ServiceTagsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_subnets_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_subnets_operations_async.py new file mode 100644 index 000000000000..3106824c4072 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_subnets_operations_async.py @@ -0,0 +1,641 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.Subnet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.SubnetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_usages_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_usages_operations_async.py new file mode 100644 index 000000000000..1958a5e69f4e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_usages_operations_async.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 Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import 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 + +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_06_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_06_01.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_appliance_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_appliance_sites_operations_async.py new file mode 100644 index 000000000000..af7550af465c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_appliance_sites_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualApplianceSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.NetworkVirtualApplianceSiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSiteListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_appliance_skus_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_appliance_skus_operations_async.py new file mode 100644 index 000000000000..66ca6655312c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_appliance_skus_operations_async.py @@ -0,0 +1,156 @@ +# 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 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 + +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_06_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_06_01.models.NetworkVirtualApplianceSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSkuListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkVirtualApplianceSku + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSku"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_hub_bgp_connection_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_bgp_connection_operations_async.py new file mode 100644 index 000000000000..00b9d523e0ce --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_bgp_connection_operations_async.py @@ -0,0 +1,333 @@ +# 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 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 + +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_06_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_06_01.models.BgpConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_virtual_hub_bgp_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_bgp_connections_operations_async.py new file mode 100644 index 000000000000..847a651a4e62 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_bgp_connections_operations_async.py @@ -0,0 +1,341 @@ +# 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 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 + +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_06_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_06_01.models.ListVirtualHubBgpConnectionResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubBgpConnectionResults"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_virtual_hub_ip_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_ip_configuration_operations_async.py new file mode 100644 index 000000000000..408d7234b7fc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_ip_configuration_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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_06_01.models.HubIpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVirtualHubIpConfigurationResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubIpConfigurationResults"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py new file mode 100644 index 000000000000..f6ab802368ca --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hub_route_table_v2_s_operations_async.py @@ -0,0 +1,409 @@ +# 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 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 + +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_06_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_06_01.models.VirtualHubRouteTableV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVirtualHubRouteTableV2SResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_hubs_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hubs_operations_async.py new file mode 100644 index 000000000000..2d2934f87db2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_hubs_operations_async.py @@ -0,0 +1,624 @@ +# 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 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 + +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_06_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_06_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py new file mode 100644 index 000000000000..02f184b81d8f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_gateway_connections_operations_async.py @@ -0,0 +1,1055 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualNetworkGatewayConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ConnectionSharedKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.VirtualNetworkGatewayConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py new file mode 100644 index 000000000000..f453e70dfa17 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_gateways_operations_async.py @@ -0,0 +1,2278 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.VirtualNetworkGatewayListConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py new file mode 100644 index 000000000000..9913709979ea --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_peerings_operations_async.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualNetworkPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualNetworkPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_network_taps_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_taps_operations_async.py new file mode 100644 index 000000000000..b4d738dac913 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_network_taps_operations_async.py @@ -0,0 +1,511 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_networks_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_networks_operations_async.py new file mode 100644 index 000000000000..8b92fdb14860 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_networks_operations_async.py @@ -0,0 +1,646 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.IPAddressAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.VirtualNetworkListUsageResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_router_peerings_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_router_peerings_operations_async.py new file mode 100644 index 000000000000..2df1e9e271d8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_router_peerings_operations_async.py @@ -0,0 +1,409 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualRouterPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualRouterPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_routers_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_routers_operations_async.py new file mode 100644 index 000000000000..4179b6dec8f9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_routers_operations_async.py @@ -0,0 +1,457 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualRouter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_virtual_wans_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_wans_operations_async.py new file mode 100644 index 000000000000..97e2ef59b282 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_virtual_wans_operations_async.py @@ -0,0 +1,511 @@ +# 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 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 + +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_06_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_06_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_vpn_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_connections_operations_async.py new file mode 100644 index 000000000000..57c4e26a4f43 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_connections_operations_async.py @@ -0,0 +1,661 @@ +# 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 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 + +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_06_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_06_01.models.VpnConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVpnConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_vpn_gateways_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_gateways_operations_async.py new file mode 100644 index 000000000000..51965acd74e9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_gateways_operations_async.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 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 + +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_06_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_06_01.models.VpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_vpn_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_link_connections_operations_async.py new file mode 100644 index 000000000000..c642be9af590 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_link_connections_operations_async.py @@ -0,0 +1,118 @@ +# 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 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 + +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_06_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_06_01.models.ListVpnSiteLinkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py new file mode 100644 index 000000000000..9595200dce07 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_server_configurations_associated_with_virtual_wan_operations_async.py @@ -0,0 +1,151 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_vpn_server_configurations_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_server_configurations_operations_async.py new file mode 100644 index 000000000000..0991025b39f9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_server_configurations_operations_async.py @@ -0,0 +1,515 @@ +# 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 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 + +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_06_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_06_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_vpn_site_link_connections_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_site_link_connections_operations_async.py new file mode 100644 index 000000000000..37b988becb76 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_site_link_connections_operations_async.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, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.VpnSiteLinkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/aio/operations_async/_vpn_site_links_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_site_links_operations_async.py new file mode 100644 index 000000000000..a5ba899d5e26 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_site_links_operations_async.py @@ -0,0 +1,172 @@ +# 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 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 + +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_06_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_06_01.models.VpnSiteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ListVpnSiteLinksResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py new file mode 100644 index 000000000000..066c1401161d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_sites_configuration_operations_async.py @@ -0,0 +1,153 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/aio/operations_async/_vpn_sites_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_sites_operations_async.py new file mode 100644 index 000000000000..1aa06aedb78f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_vpn_sites_operations_async.py @@ -0,0 +1,511 @@ +# 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 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 + +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_06_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_06_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/aio/operations_async/_web_application_firewall_policies_operations_async.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_web_application_firewall_policies_operations_async.py new file mode 100644 index 000000000000..0493d6217681 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations_async/_web_application_firewall_policies_operations_async.py @@ -0,0 +1,395 @@ +# 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 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 + +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_06_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_06_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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_06_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/models/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/__init__.py new file mode 100644 index 000000000000..158045d1142f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/__init__.py @@ -0,0 +1,1896 @@ +# 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 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 FirewallPolicy + from ._models_py3 import FirewallPolicyFilterRuleCollection + from ._models_py3 import FirewallPolicyFilterRuleCollectionAction + 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 FirewallPolicyThreatIntelWhitelist + 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 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 FirewallPolicy # type: ignore + from ._models import FirewallPolicyFilterRuleCollection # type: ignore + from ._models import FirewallPolicyFilterRuleCollectionAction # 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 FirewallPolicyThreatIntelWhitelist # 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, + 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, + FirewallPolicyFilterRuleCollectionActionType, + FirewallPolicyRuleApplicationProtocolType, + FirewallPolicyRuleCollectionType, + FirewallPolicyRuleNetworkProtocol, + FirewallPolicyRuleType, + HTTPConfigurationMethod, + HubBgpConnectionStatus, + HubVirtualNetworkConnectionStatus, + IPAllocationMethod, + IPVersion, + IkeEncryption, + IkeIntegrity, + InboundSecurityRulesProtocol, + IpAllocationType, + IpFlowProtocol, + IpsecEncryption, + IpsecIntegrity, + IssueType, + LoadBalancerOutboundRuleProtocol, + LoadBalancerSkuName, + LoadDistribution, + NetworkOperationStatus, + NextHopType, + OfficeTrafficCategory, + Origin, + OwaspCrsExclusionEntryMatchVariable, + OwaspCrsExclusionEntrySelectorMatchOperator, + PcError, + PcProtocol, + PcStatus, + PfsGroup, + PreferredIPVersion, + ProbeProtocol, + ProcessorArchitecture, + Protocol, + ProtocolType, + ProvisioningState, + PublicIPAddressSkuName, + ResourceIdentityType, + RouteNextHopType, + RoutingState, + SecurityPartnerProviderConnectionStatus, + SecurityProviderName, + SecurityRuleAccess, + SecurityRuleDirection, + SecurityRuleProtocol, + ServiceProviderProvisioningState, + Severity, + TransportProtocol, + TunnelConnectionStatus, + VerbosityLevel, + 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', + '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', + 'FirewallPolicy', + 'FirewallPolicyFilterRuleCollection', + 'FirewallPolicyFilterRuleCollectionAction', + 'FirewallPolicyListResult', + 'FirewallPolicyNatRuleCollection', + 'FirewallPolicyNatRuleCollectionAction', + 'FirewallPolicyRule', + 'FirewallPolicyRuleApplicationProtocol', + 'FirewallPolicyRuleCollection', + 'FirewallPolicyRuleCollectionGroup', + 'FirewallPolicyRuleCollectionGroupListResult', + 'FirewallPolicyThreatIntelWhitelist', + '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', + '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', + 'FirewallPolicyFilterRuleCollectionActionType', + 'FirewallPolicyRuleApplicationProtocolType', + 'FirewallPolicyRuleCollectionType', + 'FirewallPolicyRuleNetworkProtocol', + 'FirewallPolicyRuleType', + 'HTTPConfigurationMethod', + 'HubBgpConnectionStatus', + 'HubVirtualNetworkConnectionStatus', + 'IPAllocationMethod', + 'IPVersion', + 'IkeEncryption', + 'IkeIntegrity', + 'InboundSecurityRulesProtocol', + 'IpAllocationType', + 'IpFlowProtocol', + 'IpsecEncryption', + 'IpsecIntegrity', + 'IssueType', + 'LoadBalancerOutboundRuleProtocol', + 'LoadBalancerSkuName', + 'LoadDistribution', + 'NetworkOperationStatus', + 'NextHopType', + 'OfficeTrafficCategory', + 'Origin', + 'OwaspCrsExclusionEntryMatchVariable', + 'OwaspCrsExclusionEntrySelectorMatchOperator', + 'PcError', + 'PcProtocol', + 'PcStatus', + 'PfsGroup', + 'PreferredIPVersion', + 'ProbeProtocol', + 'ProcessorArchitecture', + 'Protocol', + 'ProtocolType', + 'ProvisioningState', + 'PublicIPAddressSkuName', + 'ResourceIdentityType', + 'RouteNextHopType', + 'RoutingState', + 'SecurityPartnerProviderConnectionStatus', + 'SecurityProviderName', + 'SecurityRuleAccess', + 'SecurityRuleDirection', + 'SecurityRuleProtocol', + 'ServiceProviderProvisioningState', + 'Severity', + 'TransportProtocol', + 'TunnelConnectionStatus', + 'VerbosityLevel', + '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_06_01/models/_models.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models.py new file mode 100644 index 000000000000..055350bf45a5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models.py @@ -0,0 +1,22075 @@ +# 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_06_01.models.ManagedServiceIdentity + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayRequestRoutingRule] + :param rewrite_rule_sets: Rewrite rules for the application gateway resource. + :type rewrite_rule_sets: + list[~azure.mgmt.network.v2020_06_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_06_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_06_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_06_01.models.ApplicationGatewayAutoscaleConfiguration + :param private_link_configurations: PrivateLink configurations on application gateway. + :type private_link_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayPrivateLinkConfiguration] + :ivar private_endpoint_connections: Private Endpoint connections on application gateway. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the application gateway + resource. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses. + :type backend_addresses: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2020_06_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_06_01.models.ApplicationGatewayBackendAddressPool + :param backend_health_http_settings: Application gateway BackendHealthHttp settings. + :type backend_health_http_settings: + ~azure.mgmt.network.v2020_06_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_06_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings + resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param authentication_certificates: Array of references to application gateway authentication + certificates. + :type authentication_certificates: list[~azure.mgmt.network.v2020_06_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_06_01.models.SubResource] + :param connection_draining: Connection draining of the backend http settings resource. + :type connection_draining: + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param public_ip_address: Reference to the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param private_link_configuration: Reference to the application gateway private link + configuration. + :type private_link_configuration: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param protocol: Protocol of the HTTP listener. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_06_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_06_01.models.SubResource + :param ssl_profile: SSL profile resource of the application gateway. + :type ssl_profile: ~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the HTTP listener. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayCustomError] + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path map path rule. + :type redirect_configuration: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ProvisioningState + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request to. + :type target_listener: ~azure.mgmt.network.v2020_06_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_06_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect configuration. + :type url_path_maps: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.SubResource + :param backend_http_settings: Backend http settings resource of the application gateway. + :type backend_http_settings: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2020_06_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_06_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the application gateway. + :type redirect_configuration: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewayHeaderConfiguration] + :param response_header_configurations: Response Header Actions in the Action Set. + :type response_header_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayHeaderConfiguration] + :param url_configuration: Url Configuration Action in the Action Set. + :type url_configuration: + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: "Predefined", "Custom". + :type policy_type: str or + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource] + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewaySslPolicy + :param client_auth_configuration: Client authentication configuration of the application + gateway resource. + :type client_auth_configuration: + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration resource of URL path map. + :type default_redirect_configuration: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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 + + +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_06_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_06_01.models.FirewallPolicyRuleApplicationProtocol] + :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] + """ + + _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]'}, + 'fqdn_tags': {'key': 'fqdnTags', 'type': '[str]'}, + 'source_ip_groups': {'key': 'sourceIpGroups', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationRule, self).__init__(**kwargs) + self.rule_type = 'ApplicationRule' + 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.fqdn_tags = kwargs.get('fqdn_tags', None) + self.source_ip_groups = kwargs.get('source_ip_groups', 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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.NetworkOperationStatus + :param error: Details of the error occurred during specified asynchronous operation. + :type error: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.AzureFirewallNetworkRuleCollection] + :param ip_configurations: IP configuration of the Azure Firewall resource. + :type ip_configurations: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.AzureFirewallThreatIntelMode + :param virtual_hub: The virtualHub to which the firewall belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param firewall_policy: The firewallPolicy associated with this azure firewall. + :type firewall_policy: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param hub_ip_addresses: IP addresses associated with AzureFirewall. + :type hub_ip_addresses: ~azure.mgmt.network.v2020_06_01.models.HubIPAddresses + :ivar ip_groups: IpGroups associated with AzureFirewall. + :vartype ip_groups: list[~azure.mgmt.network.v2020_06_01.models.AzureFirewallIpGroups] + :param sku: The Azure Firewall Resource SKU. + :type sku: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a application rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.AzureFirewallNatRCAction + :param rules: Collection of rules used by a NAT rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a network rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.AzureFirewallSkuName + :param tier: Tier of an Azure Firewall. Possible values include: "Standard", "Premium". + :type tier: str or ~azure.mgmt.network.v2020_06_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_06_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report items. + :type reachability_report: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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 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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _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 + """ + + _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_06_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_06_01.models.ConnectionMonitorEndpointFilter + :param scope: Endpoint scope. + :type scope: ~azure.mgmt.network.v2020_06_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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The behavior of the endpoint filter. Currently only 'Include' is supported. Default + value: "Include". + :vartype type: str + :param items: List of items in the filter. + :type items: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorEndpointFilterItem] + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'items': {'key': 'items', 'type': '[ConnectionMonitorEndpointFilterItem]'}, + } + + type = "Include" + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpointFilter, self).__init__(**kwargs) + self.items = kwargs.get('items', None) + + +class ConnectionMonitorEndpointFilterItem(msrest.serialization.Model): + """Describes the connection monitor endpoint filter item. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of item included in the filter. Currently only 'AgentAddress' is + supported. Default value: "AgentAddress". + :vartype type: str + :param address: The address of the filter item. + :type address: str + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + } + + type = "AgentAddress" + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorEndpointFilterItem, self).__init__(**kwargs) + 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_06_01.models.ConnectionMonitorEndpointScopeItem] + :param exclude: List of items which needs to be excluded from the endpoint scope. + :type exclude: list[~azure.mgmt.network.v2020_06_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_06_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_06_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 + """ + + _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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Connection monitor output destination type. Currently, only "Workspace" is + supported. Default value: "Workspace". + :vartype type: str + :param workspace_settings: Describes the settings for producing output into a log analytics + workspace. + :type workspace_settings: + ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorWorkspaceSettings + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_settings': {'key': 'workspaceSettings', 'type': 'ConnectionMonitorWorkspaceSettings'}, + } + + type = "Workspace" + + def __init__( + self, + **kwargs + ): + super(ConnectionMonitorOutput, self).__init__(**kwargs) + 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_06_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _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_06_01.models.ConnectionMonitorSourceStatus + :param states: Information about connection states. + :type states: list[~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ConnectionMonitorType + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + '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_06_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ConnectionMonitorType + """ + + _validation = { + '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}, + } + + _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_06_01.models.DestinationPortBehavior + """ + + _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_06_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_06_01.models.PreferredIPVersion + :param http_configuration: The parameters used to perform test evaluation over HTTP. + :type http_configuration: + ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorHttpConfiguration + :param tcp_configuration: The parameters used to perform test evaluation over TCP. + :type tcp_configuration: + ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTcpConfiguration + :param icmp_configuration: The parameters used to perform test evaluation over ICMP. + :type icmp_configuration: + ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorIcmpConfiguration + :param success_threshold: The threshold for declaring a test successful. + :type success_threshold: + ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.EvaluationState + :param avg_latency_in_ms: Average latency in ms. + :type avg_latency_in_ms: int + :param min_latency_in_ms: Minimum latency in ms. + :type min_latency_in_ms: int + :param max_latency_in_ms: Maximum latency in ms. + :type max_latency_in_ms: int + :param probes_sent: The number of sent probes. + :type probes_sent: int + :param probes_failed: The number of failed probes. + :type probes_failed: int + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2020_06_01.models.ConnectivityHop] + """ + + _validation = { + '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': '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'}, + '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 + """ + + _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_06_01.models.HopLink] + :ivar previous_links: List of previous hop links. + :vartype previous_links: list[~azure.mgmt.network.v2020_06_01.models.HopLink] + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: "Error", "Warning". + :vartype severity: str or ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ConnectivitySource + :param destination: Required. The destination of connection. + :type destination: ~azure.mgmt.network.v2020_06_01.models.ConnectivityDestination + :param protocol: Network protocol. Possible values include: "Tcp", "Http", "Https", "Icmp". + :type protocol: str or ~azure.mgmt.network.v2020_06_01.models.Protocol + :param protocol_configuration: Configuration of the protocol. + :type protocol_configuration: ~azure.mgmt.network.v2020_06_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_06_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}, + } + + _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_06_01.models.ContainerNetworkInterfaceConfiguration + :param container: Reference to the container to which this container network interface is + attached. + :type container: ~azure.mgmt.network.v2020_06_01.models.SubResource + :ivar ip_configurations: Reference to the ip configuration on this container nic. + :vartype ip_configurations: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.CommissionedState + :ivar public_ip_prefixes: The list of all referenced PublicIpPrefixes. + :vartype public_ip_prefixes: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.SubResource] + :param protocol_custom_settings: The protocol-specific DDoS policy customization parameters. + :type protocol_custom_settings: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.QosIpRange] + :param destination_ip_ranges: Destination IP ranges. + :type destination_ip_ranges: list[~azure.mgmt.network.v2020_06_01.models.QosIpRange] + :param source_port_ranges: Sources port ranges. + :type source_port_ranges: list[~azure.mgmt.network.v2020_06_01.models.QosPortRange] + :param destination_port_ranges: Destination port ranges. + :type destination_port_ranges: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2020_06_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_06_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_06_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values include: "Active", "Invalid". + :type state: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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: ~azure.mgmt.network.v2020_06_01.models.Resource + :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'}, + '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_06_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_06_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_06_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_06_01.models.MatchedRule + :ivar rules_evaluation_result: List of network security rules evaluation results. + :vartype rules_evaluation_result: + list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_06_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_06_01.models.ExpressRouteCircuitPeeringConfig + :param stats: The peering stats of express route circuit. + :type stats: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.SubResource + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2020_06_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param express_route_connection: The ExpressRoute connection. + :type express_route_connection: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values include: "UnlimitedData", "MeteredData". + :type family: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ProvisioningState + :param express_route_circuit_peering: The ExpressRoute circuit peering. + :type express_route_circuit_peering: + ~azure.mgmt.network.v2020_06_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 routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_06_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'}, + '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.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_06_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_06_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_06_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_06_01.models.ProvisioningState + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration + :ivar express_route_connections: List of ExpressRoute connections to the ExpressRoute gateway. + :vartype express_route_connections: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ProvisioningState + :param mac_sec_config: MacSec configuration. + :type mac_sec_config: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ExpressRouteLinkMacSecCipher + :param sci_state: Sci mode enabled/disabled. Possible values include: "Disabled", "Enabled". + :type sci_state: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ExpressRouteLink] + :ivar circuits: Reference the ExpressRoute circuit(s) that are provisioned on this + ExpressRoutePort resource. + :vartype circuits: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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 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 + :ivar rule_collection_groups: List of references to FirewallPolicyRuleCollectionGroups. + :vartype rule_collection_groups: list[~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + :param base_policy: The parent firewall policy from which rules are inherited. + :type base_policy: ~azure.mgmt.network.v2020_06_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_06_01.models.SubResource] + :ivar child_policies: List of references to Child Firewall Policies. + :vartype child_policies: list[~azure.mgmt.network.v2020_06_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_06_01.models.AzureFirewallThreatIntelMode + :param threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. + :type threat_intel_whitelist: + ~azure.mgmt.network.v2020_06_01.models.FirewallPolicyThreatIntelWhitelist + :param dns_settings: DNS Proxy Settings definition. + :type dns_settings: ~azure.mgmt.network.v2020_06_01.models.DnsSettings + """ + + _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'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + super(FirewallPolicy, self).__init__(**kwargs) + self.etag = 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) + + +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_06_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 + 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_06_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_06_01.models.FirewallPolicyFilterRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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' + 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_06_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 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_06_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_06_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_06_01.models.FirewallPolicyNatRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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' + self.action = kwargs.get('action', None) + self.rules = kwargs.get('rules', None) + + +class FirewallPolicyNatRuleCollectionAction(msrest.serialization.Model): + """Properties of the FirewallPolicyNatRuleCollectionAction. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of action. Default value: "DNAT". + :vartype type: str + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "DNAT" + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyNatRuleCollectionAction, self).__init__(**kwargs) + + +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_06_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_06_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_06_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_06_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 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 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_06_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_06_01.models.FlowLogFormatParameters + :param flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :type flow_analytics_configuration: + ~azure.mgmt.network.v2020_06_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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The file type of flow log. Default value: "JSON". + :vartype type: str + :param version: The version (revision) of the flow log. + :type version: int + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + } + + type = "JSON" + + def __init__( + self, + **kwargs + ): + super(FlowLogFormatParameters, self).__init__(**kwargs) + 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_06_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_06_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.IPVersion + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.Subnet + :param public_ip_address: The reference to the Public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_01.models.PublicIPAddress + :param public_ip_prefix: The reference to the Public IP Prefix resource. + :type public_ip_prefix: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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: int + :ivar round_trip_time_avg: Average roundtrip time in milliseconds. + :vartype round_trip_time_avg: int + :ivar round_trip_time_max: Maximum roundtrip time in milliseconds. + :vartype round_trip_time_max: int + """ + + _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}, + 'round_trip_time_avg': {'readonly': True}, + 'round_trip_time_max': {'readonly': True}, + } + + _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': 'int'}, + 'round_trip_time_avg': {'key': 'properties.roundTripTimeAvg', 'type': 'int'}, + 'round_trip_time_max': {'key': 'properties.roundTripTimeMax', 'type': 'int'}, + } + + 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar method: HTTP method. Default value: "Get". + :vartype method: str + :param headers: List of HTTP headers. + :type headers: list[~azure.mgmt.network.v2020_06_01.models.HTTPHeader] + :param valid_status_codes: Valid status codes. + :type valid_status_codes: list[int] + """ + + _validation = { + 'method': {'constant': True}, + } + + _attribute_map = { + 'method': {'key': 'method', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '[HTTPHeader]'}, + 'valid_status_codes': {'key': 'validStatusCodes', 'type': '[int]'}, + } + + method = "Get" + + def __init__( + self, + **kwargs + ): + super(HTTPConfiguration, self).__init__(**kwargs) + 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_06_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_06_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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[~azure.mgmt.network.v2020_06_01.models.SubResource] + :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] + :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 + """ + + _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': '[SubResource]'}, + 'propagating_connections': {'key': 'properties.propagatingConnections', 'type': '[SubResource]'}, + '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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :ivar virtual_network: The VirtualNetwork that using the prefix of this IpAllocation resource. + :vartype virtual_network: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.ProvisioningState + :param ip_addresses: IpAddresses/IpAddressPrefixes in the IpGroups resource. + :type ip_addresses: list[str] + :ivar firewalls: List of references to Azure resources that this IpGroups is associated with. + :vartype firewalls: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'firewalls': {'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]'}, + } + + 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 + + +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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference to the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param state: The state of peering. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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 sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer. + :type probes: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.InboundNatPool] + :param outbound_rules: The outbound rules. + :type outbound_rules: list[~azure.mgmt.network.v2020_06_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_06_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}'}, + '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.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_06_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_06_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'}, + } + + 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 + + +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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = kwargs.get('name', 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_06_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_06_01.models.SubResource + :param probe: The reference to the load balancer probe used by the load balancing rule. + :type probe: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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. + + 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 rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :ivar state: The state of the managed rule. Defaults to Disabled if not specified. Default + value: "Disabled". + :vartype state: str + """ + + _validation = { + 'rule_id': {'required': True}, + 'state': {'constant': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + state = "Disabled" + + def __init__( + self, + **kwargs + ): + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = kwargs['rule_id'] + + +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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource] + :ivar subnets: An array of references to the subnets using this nat gateway resource. + :vartype subnets: list[~azure.mgmt.network.v2020_06_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_06_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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of Nat Gateway SKU. Default value: "Standard". + :vartype name: str + """ + + _validation = { + 'name': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "Standard" + + def __init__( + self, + **kwargs + ): + super(NatGatewaySku, self).__init__(**kwargs) + + +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_06_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_06_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] + """ + + _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]'}, + } + + def __init__( + self, + **kwargs + ): + super(NatRule, self).__init__(**kwargs) + self.rule_type = 'NatRule' + 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) + + +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_06_01.models.VerbosityLevel + :param profiles: Required. List of network configuration diagnostic profiles. + :type profiles: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.NetworkConfigurationDiagnosticProfile + :param network_security_group_result: Network security group result. + :type network_security_group_result: + ~azure.mgmt.network.v2020_06_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_06_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] + :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_06_01.models.SubResource + :param network_security_group: The reference to the NetworkSecurityGroup resource. + :type network_security_group: ~azure.mgmt.network.v2020_06_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_06_01.models.PrivateEndpoint + :param ip_configurations: A list of IPConfigurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfiguration] + :ivar tap_configurations: A list of TapConfigurations of the network interface. + :vartype tap_configurations: + list[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceTapConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: ~azure.mgmt.network.v2020_06_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_06_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_06_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}'}, + '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.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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ProvisioningState + :ivar private_link_connection_properties: PrivateLinkConnection properties for the network + interface. + :vartype private_link_connection_properties: + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_06_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' + 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_06_01.models.SecurityRule] + :ivar default_security_rules: The default security rules of network security group. + :vartype default_security_rules: list[~azure.mgmt.network.v2020_06_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network interfaces. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_06_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_06_01.models.Subnet] + :ivar flow_logs: A collection of references to flow log resources. + :vartype flow_logs: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.VirtualApplianceNicProperties] + :ivar virtual_appliance_sites: List of references to VirtualApplianceSite. + :vartype virtual_appliance_sites: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :ivar inbound_security_rules: List of references to InboundSecurityRules. + :vartype inbound_security_rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :ivar vpn_client_connection_health: All P2S VPN clients' connection health status. + :vartype vpn_client_connection_health: + ~azure.mgmt.network.v2020_06_01.models.VpnClientConnectionHealth + :param custom_dns_servers: List of all customer specified DNS servers IP addresses. + :type custom_dns_servers: list[str] + """ + + _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]'}, + } + + 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) + + +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_06_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_06_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_06_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + '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_06_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_06_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_06_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_06_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + '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_06_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_06_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_06_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + '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': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + '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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_06_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + '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_06_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. Default value: "Community". + :vartype route_filter_rule_type: str + :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_06_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'route_filter_rule_type': {'constant': 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'}, + } + + route_filter_rule_type = "Community" + + def __init__( + self, + **kwargs + ): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.name = None + self.etag = None + self.access = kwargs.get('access', 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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.WebApplicationFirewallEnabledState + :param mode: The mode of the policy. Possible values include: "Prevention", "Detection". + :type mode: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.PrivateLinkServiceConnection] + :param custom_dns_configs: An array of custom dns configurations. + :type custom_dns_configs: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.FrontendIPConfiguration] + :param ip_configurations: An array of private link service IP configurations. + :type ip_configurations: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.PrivateEndpointConnection] + :param visibility: The visibility list of the private link service. + :type visibility: ~azure.mgmt.network.v2020_06_01.models.ResourceSet + :param auto_approval: The auto-approval list of the private link service. + :type auto_approval: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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 sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP address. + :vartype ip_configuration: ~azure.mgmt.network.v2020_06_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_06_01.models.PublicIPAddressDnsSettings + :param ddos_settings: The DDoS protection custom policy associated with the public IP address. + :type ddos_settings: ~azure.mgmt.network.v2020_06_01.models.DdosSettings + :param ip_tags: The list of tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.network.v2020_06_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_06_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_06_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}'}, + '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.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_06_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_06_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = kwargs.get('name', 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 sku: The public IP prefix SKU. + :type sku: ~azure.mgmt.network.v2020_06_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_06_01.models.IPVersion + :param ip_tags: The list of tags associated with the public IP prefix. + :type ip_tags: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.SubResource + :param custom_ip_prefix: The customIpPrefix that this prefix is associated with. + :type custom_ip_prefix: ~azure.mgmt.network.v2020_06_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_06_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}'}, + '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.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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of a public IP prefix SKU. Default value: "Standard". + :vartype name: str + """ + + _validation = { + 'name': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "Standard" + + def __init__( + self, + **kwargs + ): + super(PublicIPPrefixSku, self).__init__(**kwargs) + + +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_06_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_06_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_06_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_06_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_06_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_06_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. Default value: "Community". + :vartype route_filter_rule_type: str + :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_06_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'route_filter_rule_type': {'constant': 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'}, + } + + route_filter_rule_type = "Community" + + 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.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_06_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_06_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_06_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.SubResource + :param propagated_route_tables: The list of RouteTables to advertise the routes to. + :type propagated_route_tables: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SecurityPartnerProviderConnectionStatus + :param virtual_hub: The virtualHub to which the Security Partner Provider belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.NetworkInterfaceAssociation + :param subnet_association: Subnet and it's custom security rules. + :type subnet_association: ~azure.mgmt.network.v2020_06_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_06_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.ServiceEndpointPolicyDefinition] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ServiceTagInformation] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'change_number': {'readonly': True}, + 'cloud': {'readonly': True}, + 'values': {'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]'}, + } + + 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 + + +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_06_01.models.NetworkSecurityGroup + :param route_table: The reference to the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2020_06_01.models.RouteTable + :param nat_gateway: Nat gateway associated with this subnet. + :type nat_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPropertiesFormat] + :param service_endpoint_policies: An array of service endpoint policies. + :type service_endpoint_policies: + list[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicy] + :ivar private_endpoints: An array of references to private endpoints. + :vartype private_endpoints: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.IPConfigurationProfile] + :param ip_allocations: Array of IpAllocation which reference this subnet. + :type ip_allocations: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ServiceAssociationLink] + :param delegations: An array of references to the delegations on the subnet. + :type delegations: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param target_subnet: The reference to the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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 + :ivar unit: Required. An enum describing the unit of measurement. Default value: "Count". + :vartype unit: str + :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_06_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': 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'}, + } + + unit = "Count" + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = None + 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_06_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_06_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values include: "TCP", "UDP". + :type protocol: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param vpn_gateway: The VpnGateway associated with this VirtualHub. + :type vpn_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param p2_s_vpn_gateway: The P2SVpnGateway associated with this VirtualHub. + :type p2_s_vpn_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param express_route_gateway: The expressRouteGateway associated with this VirtualHub. + :type express_route_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param azure_firewall: The azureFirewall associated with this VirtualHub. + :type azure_firewall: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param security_partner_provider: The securityPartnerProvider associated with this VirtualHub. + :type security_partner_provider: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.RoutingState + :ivar bgp_connections: List of references to Bgp Connections. + :vartype bgp_connections: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :ivar ip_configurations: List of references to IpConfigurations. + :vartype ip_configurations: list[~azure.mgmt.network.v2020_06_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 enable_virtual_router_route_propogation: Flag to control route propogation for + VirtualRouter hub. + :type enable_virtual_router_route_propogation: 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]'}, + 'enable_virtual_router_route_propogation': {'key': 'properties.enableVirtualRouterRoutePropogation', '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.enable_virtual_router_route_propogation = kwargs.get('enable_virtual_router_route_propogation', 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_06_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_06_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_06_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_06_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] + :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_06_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_06_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2020_06_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.VirtualNetworkBgpCommunities + :param ip_allocations: Array of IpAllocation which reference this VNET. + :type ip_allocations: list[~azure.mgmt.network.v2020_06_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}'}, + '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.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_06_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible values include: "Vpn", + "ExpressRoute". + :type gateway_type: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_06_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_06_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_06_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 + """ + + _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'}, + } + + 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 + + +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_06_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: ~azure.mgmt.network.v2020_06_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_06_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_06_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 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_06_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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'}, + '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.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_06_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.VirtualNetworkGatewayConnectionProtocol + :param routing_weight: The routing weight. + :type routing_weight: int + :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_06_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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'}, + '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.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_06_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_06_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param remote_address_space: The reference to the remote virtual network address space. + :type remote_address_space: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param hosted_gateway: The Gateway on which VirtualRouter is hosted. + :type hosted_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :ivar peerings: List of references to VirtualRouterPeerings. + :vartype peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource] + :ivar vpn_sites: List of VpnSites in the VirtualWAN. + :vartype vpn_sites: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network + gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ProcessorArchitecture + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param connections: List of all vpn connections to the gateway. + :type connections: list[~azure.mgmt.network.v2020_06_01.models.VpnConnection] + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.VpnGatewayIpConfiguration] + """ + + _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]'}, + } + + 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 + + +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_06_01.models.VpnGatewayTunnelingProtocol] + :param vpn_authentication_types: VPN authentication types for the VpnServerConfiguration. + :type vpn_authentication_types: list[str or + ~azure.mgmt.network.v2020_06_01.models.VpnAuthenticationType] + :param vpn_client_root_certificates: VPN client root certificate of VpnServerConfiguration. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnServerConfigVpnClientRootCertificate] + :param vpn_client_revoked_certificates: VPN client revoked certificate of + VpnServerConfiguration. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnServerConfigVpnClientRevokedCertificate] + :param radius_server_root_certificates: Radius Server root certificate of + VpnServerConfiguration. + :type radius_server_root_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnServerConfigRadiusServerRootCertificate] + :param radius_client_root_certificates: Radius client root certificate of + VpnServerConfiguration. + :type radius_client_root_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnServerConfigRadiusClientRootCertificate] + :param vpn_client_ipsec_policies: VpnClientIpsecPolicies for VpnServerConfiguration. + :type vpn_client_ipsec_policies: list[~azure.mgmt.network.v2020_06_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_06_01.models.RadiusServer] + :param aad_authentication_parameters: The set of aad vpn authentication parameters. + :type aad_authentication_parameters: + ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.SubResource + :param device_properties: The device properties. + :type device_properties: ~azure.mgmt.network.v2020_06_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_06_01.models.AddressSpace + :param bgp_properties: The set of bgp properties. + :type bgp_properties: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.VpnSiteLink] + :param o365_policy: Office365 Policy. + :type o365_policy: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.WebApplicationFirewallRuleType + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.network.v2020_06_01.models.MatchCondition] + :param action: Required. Type of Actions. Possible values include: "Allow", "Block", "Log". + :type action: str or ~azure.mgmt.network.v2020_06_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_06_01.models.PolicySettings + :param custom_rules: The custom rules inside the policy. + :type custom_rules: + list[~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallCustomRule] + :ivar application_gateways: A collection of references to application gateways. + :vartype application_gateways: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.WebApplicationFirewallPolicyResourceState + :param managed_rules: Describes the managedRules structure. + :type managed_rules: ~azure.mgmt.network.v2020_06_01.models.ManagedRulesDefinition + :ivar http_listeners: A collection of references to application gateway http listeners. + :vartype http_listeners: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01/models/_models_py3.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models_py3.py new file mode 100644 index 000000000000..f1c6a38f0942 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_models_py3.py @@ -0,0 +1,24514 @@ +# 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_06_01.models.ManagedServiceIdentity + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayRequestRoutingRule] + :param rewrite_rule_sets: Rewrite rules for the application gateway resource. + :type rewrite_rule_sets: + list[~azure.mgmt.network.v2020_06_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_06_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_06_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_06_01.models.ApplicationGatewayAutoscaleConfiguration + :param private_link_configurations: PrivateLink configurations on application gateway. + :type private_link_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayPrivateLinkConfiguration] + :ivar private_endpoint_connections: Private Endpoint connections on application gateway. + :vartype private_endpoint_connections: + list[~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the application gateway + resource. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses. + :type backend_addresses: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2020_06_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_06_01.models.ApplicationGatewayBackendAddressPool + :param backend_health_http_settings: Application gateway BackendHealthHttp settings. + :type backend_health_http_settings: + ~azure.mgmt.network.v2020_06_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_06_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings + resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param authentication_certificates: Array of references to application gateway authentication + certificates. + :type authentication_certificates: list[~azure.mgmt.network.v2020_06_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_06_01.models.SubResource] + :param connection_draining: Connection draining of the backend http settings resource. + :type connection_draining: + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param public_ip_address: Reference to the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param private_link_configuration: Reference to the application gateway private link + configuration. + :type private_link_configuration: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param protocol: Protocol of the HTTP listener. Possible values include: "Http", "Https". + :type protocol: str or ~azure.mgmt.network.v2020_06_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_06_01.models.SubResource + :param ssl_profile: SSL profile resource of the application gateway. + :type ssl_profile: ~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + :param custom_error_configurations: Custom error configurations of the HTTP listener. + :type custom_error_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayCustomError] + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path map path rule. + :type redirect_configuration: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ProvisioningState + :param firewall_policy: Reference to the FirewallPolicy resource. + :type firewall_policy: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.IPAllocationMethod + :param subnet: Reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request to. + :type target_listener: ~azure.mgmt.network.v2020_06_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_06_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect configuration. + :type url_path_maps: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.SubResource + :param backend_http_settings: Backend http settings resource of the application gateway. + :type backend_http_settings: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2020_06_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_06_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the application gateway. + :type redirect_configuration: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewayHeaderConfiguration] + :param response_header_configurations: Response Header Actions in the Action Set. + :type response_header_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ApplicationGatewayHeaderConfiguration] + :param url_configuration: Url Configuration Action in the Action Set. + :type url_configuration: + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: "Predefined", "Custom". + :type policy_type: str or + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource] + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: ~azure.mgmt.network.v2020_06_01.models.ApplicationGatewaySslPolicy + :param client_auth_configuration: Client authentication configuration of the application + gateway resource. + :type client_auth_configuration: + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration resource of URL path map. + :type default_redirect_configuration: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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: Optional[str] = None + + +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_06_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_06_01.models.FirewallPolicyRuleApplicationProtocol] + :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] + """ + + _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]'}, + '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, + destination_addresses: Optional[List[str]] = None, + protocols: Optional[List["FirewallPolicyRuleApplicationProtocol"]] = None, + target_fqdns: Optional[List[str]] = None, + fqdn_tags: Optional[List[str]] = None, + source_ip_groups: Optional[List[str]] = None, + **kwargs + ): + super(ApplicationRule, self).__init__(name=name, description=description, **kwargs) + self.rule_type: str = 'ApplicationRule' + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.protocols = protocols + self.target_fqdns = target_fqdns + self.fqdn_tags = fqdn_tags + self.source_ip_groups = source_ip_groups + + +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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.NetworkOperationStatus + :param error: Details of the error occurred during specified asynchronous operation. + :type error: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.AzureFirewallNetworkRuleCollection] + :param ip_configurations: IP configuration of the Azure Firewall resource. + :type ip_configurations: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.AzureFirewallThreatIntelMode + :param virtual_hub: The virtualHub to which the firewall belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param firewall_policy: The firewallPolicy associated with this azure firewall. + :type firewall_policy: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param hub_ip_addresses: IP addresses associated with AzureFirewall. + :type hub_ip_addresses: ~azure.mgmt.network.v2020_06_01.models.HubIPAddresses + :ivar ip_groups: IpGroups associated with AzureFirewall. + :vartype ip_groups: list[~azure.mgmt.network.v2020_06_01.models.AzureFirewallIpGroups] + :param sku: The Azure Firewall Resource SKU. + :type sku: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a application rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.AzureFirewallNatRCAction + :param rules: Collection of rules used by a NAT rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a network rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.AzureFirewallSkuName + :param tier: Tier of an Azure Firewall. Possible values include: "Standard", "Premium". + :type tier: str or ~azure.mgmt.network.v2020_06_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_06_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report items. + :type reachability_report: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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 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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _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 + """ + + _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_06_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_06_01.models.ConnectionMonitorEndpointFilter + :param scope: Endpoint scope. + :type scope: ~azure.mgmt.network.v2020_06_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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The behavior of the endpoint filter. Currently only 'Include' is supported. Default + value: "Include". + :vartype type: str + :param items: List of items in the filter. + :type items: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorEndpointFilterItem] + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'items': {'key': 'items', 'type': '[ConnectionMonitorEndpointFilterItem]'}, + } + + type = "Include" + + def __init__( + self, + *, + items: Optional[List["ConnectionMonitorEndpointFilterItem"]] = None, + **kwargs + ): + super(ConnectionMonitorEndpointFilter, self).__init__(**kwargs) + self.items = items + + +class ConnectionMonitorEndpointFilterItem(msrest.serialization.Model): + """Describes the connection monitor endpoint filter item. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of item included in the filter. Currently only 'AgentAddress' is + supported. Default value: "AgentAddress". + :vartype type: str + :param address: The address of the filter item. + :type address: str + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + } + + type = "AgentAddress" + + def __init__( + self, + *, + address: Optional[str] = None, + **kwargs + ): + super(ConnectionMonitorEndpointFilterItem, self).__init__(**kwargs) + 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_06_01.models.ConnectionMonitorEndpointScopeItem] + :param exclude: List of items which needs to be excluded from the endpoint scope. + :type exclude: list[~azure.mgmt.network.v2020_06_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_06_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_06_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 + """ + + _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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Connection monitor output destination type. Currently, only "Workspace" is + supported. Default value: "Workspace". + :vartype type: str + :param workspace_settings: Describes the settings for producing output into a log analytics + workspace. + :type workspace_settings: + ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorWorkspaceSettings + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_settings': {'key': 'workspaceSettings', 'type': 'ConnectionMonitorWorkspaceSettings'}, + } + + type = "Workspace" + + def __init__( + self, + *, + workspace_settings: Optional["ConnectionMonitorWorkspaceSettings"] = None, + **kwargs + ): + super(ConnectionMonitorOutput, self).__init__(**kwargs) + 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_06_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorOutput] + :param notes: Optional notes to be associated with the connection monitor. + :type notes: str + """ + + _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_06_01.models.ConnectionMonitorSourceStatus + :param states: Information about connection states. + :type states: list[~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ConnectionMonitorType + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + '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_06_01.models.ConnectionMonitorSource + :param destination: Describes the destination of connection monitor. + :type destination: ~azure.mgmt.network.v2020_06_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_06_01.models.ConnectionMonitorEndpoint] + :param test_configurations: List of connection monitor test configurations. + :type test_configurations: + list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestConfiguration] + :param test_groups: List of connection monitor test groups. + :type test_groups: list[~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTestGroup] + :param outputs: List of connection monitor outputs. + :type outputs: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ConnectionMonitorType + """ + + _validation = { + '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}, + } + + _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_06_01.models.DestinationPortBehavior + """ + + _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_06_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_06_01.models.PreferredIPVersion + :param http_configuration: The parameters used to perform test evaluation over HTTP. + :type http_configuration: + ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorHttpConfiguration + :param tcp_configuration: The parameters used to perform test evaluation over TCP. + :type tcp_configuration: + ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorTcpConfiguration + :param icmp_configuration: The parameters used to perform test evaluation over ICMP. + :type icmp_configuration: + ~azure.mgmt.network.v2020_06_01.models.ConnectionMonitorIcmpConfiguration + :param success_threshold: The threshold for declaring a test successful. + :type success_threshold: + ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.EvaluationState + :param avg_latency_in_ms: Average latency in ms. + :type avg_latency_in_ms: int + :param min_latency_in_ms: Minimum latency in ms. + :type min_latency_in_ms: int + :param max_latency_in_ms: Maximum latency in ms. + :type max_latency_in_ms: int + :param probes_sent: The number of sent probes. + :type probes_sent: int + :param probes_failed: The number of failed probes. + :type probes_failed: int + :ivar hops: List of hops between the source and the destination. + :vartype hops: list[~azure.mgmt.network.v2020_06_01.models.ConnectivityHop] + """ + + _validation = { + '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': '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'}, + '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 + """ + + _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_06_01.models.HopLink] + :ivar previous_links: List of previous hop links. + :vartype previous_links: list[~azure.mgmt.network.v2020_06_01.models.HopLink] + :ivar issues: List of issues. + :vartype issues: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: "Error", "Warning". + :vartype severity: str or ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ConnectivitySource + :param destination: Required. The destination of connection. + :type destination: ~azure.mgmt.network.v2020_06_01.models.ConnectivityDestination + :param protocol: Network protocol. Possible values include: "Tcp", "Http", "Https", "Icmp". + :type protocol: str or ~azure.mgmt.network.v2020_06_01.models.Protocol + :param protocol_configuration: Configuration of the protocol. + :type protocol_configuration: ~azure.mgmt.network.v2020_06_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_06_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}, + } + + _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_06_01.models.ContainerNetworkInterfaceConfiguration + :param container: Reference to the container to which this container network interface is + attached. + :type container: ~azure.mgmt.network.v2020_06_01.models.SubResource + :ivar ip_configurations: Reference to the ip configuration on this container nic. + :vartype ip_configurations: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.CommissionedState + :ivar public_ip_prefixes: The list of all referenced PublicIpPrefixes. + :vartype public_ip_prefixes: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.SubResource] + :param protocol_custom_settings: The protocol-specific DDoS policy customization parameters. + :type protocol_custom_settings: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.QosIpRange] + :param destination_ip_ranges: Destination IP ranges. + :type destination_ip_ranges: list[~azure.mgmt.network.v2020_06_01.models.QosIpRange] + :param source_port_ranges: Sources port ranges. + :type source_port_ranges: list[~azure.mgmt.network.v2020_06_01.models.QosPortRange] + :param destination_port_ranges: Destination port ranges. + :type destination_port_ranges: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2020_06_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_06_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_06_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values include: "Active", "Invalid". + :type state: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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: ~azure.mgmt.network.v2020_06_01.models.Resource + :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'}, + 'virtual_wan_resource_type': {'key': 'virtualWanResourceType', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional["Resource"] = 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_06_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_06_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_06_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_06_01.models.MatchedRule + :ivar rules_evaluation_result: List of network security rules evaluation results. + :vartype rules_evaluation_result: + list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_06_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_06_01.models.ExpressRouteCircuitPeeringConfig + :param stats: The peering stats of express route circuit. + :type stats: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.SubResource + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2020_06_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param express_route_connection: The ExpressRoute connection. + :type express_route_connection: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values include: "UnlimitedData", "MeteredData". + :type family: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ProvisioningState + :param express_route_circuit_peering: The ExpressRoute circuit peering. + :type express_route_circuit_peering: + ~azure.mgmt.network.v2020_06_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 routing_configuration: The Routing Configuration indicating the associated and + propagated route tables on this connection. + :type routing_configuration: ~azure.mgmt.network.v2020_06_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'}, + '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, + 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.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_06_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_06_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_06_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_06_01.models.ProvisioningState + :param peerings: The list of peerings. + :type peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ExpressRoutePeeringType + :param state: The peering state. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration + :ivar express_route_connections: List of ExpressRoute connections to the ExpressRoute gateway. + :vartype express_route_connections: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ProvisioningState + :param mac_sec_config: MacSec configuration. + :type mac_sec_config: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ExpressRouteLinkMacSecCipher + :param sci_state: Sci mode enabled/disabled. Possible values include: "Disabled", "Enabled". + :type sci_state: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ExpressRouteLink] + :ivar circuits: Reference the ExpressRoute circuit(s) that are provisioned on this + ExpressRoutePort resource. + :vartype circuits: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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 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 + :ivar rule_collection_groups: List of references to FirewallPolicyRuleCollectionGroups. + :vartype rule_collection_groups: list[~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + :param base_policy: The parent firewall policy from which rules are inherited. + :type base_policy: ~azure.mgmt.network.v2020_06_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_06_01.models.SubResource] + :ivar child_policies: List of references to Child Firewall Policies. + :vartype child_policies: list[~azure.mgmt.network.v2020_06_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_06_01.models.AzureFirewallThreatIntelMode + :param threat_intel_whitelist: ThreatIntel Whitelist for Firewall Policy. + :type threat_intel_whitelist: + ~azure.mgmt.network.v2020_06_01.models.FirewallPolicyThreatIntelWhitelist + :param dns_settings: DNS Proxy Settings definition. + :type dns_settings: ~azure.mgmt.network.v2020_06_01.models.DnsSettings + """ + + _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'}, + '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'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = 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, + **kwargs + ): + super(FirewallPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = None + 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 + + +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_06_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: Optional[str] = None + 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_06_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_06_01.models.FirewallPolicyFilterRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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: str = 'FirewallPolicyFilterRuleCollection' + 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_06_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 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_06_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_06_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_06_01.models.FirewallPolicyNatRuleCollectionAction + :param rules: List of rules included in a rule collection. + :type rules: list[~azure.mgmt.network.v2020_06_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: str = 'FirewallPolicyNatRuleCollection' + self.action = action + self.rules = rules + + +class FirewallPolicyNatRuleCollectionAction(msrest.serialization.Model): + """Properties of the FirewallPolicyNatRuleCollectionAction. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of action. Default value: "DNAT". + :vartype type: str + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "DNAT" + + def __init__( + self, + **kwargs + ): + super(FirewallPolicyNatRuleCollectionAction, self).__init__(**kwargs) + + +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_06_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_06_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_06_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_06_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 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 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_06_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_06_01.models.FlowLogFormatParameters + :param flow_analytics_configuration: Parameters that define the configuration of traffic + analytics. + :type flow_analytics_configuration: + ~azure.mgmt.network.v2020_06_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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The file type of flow log. Default value: "JSON". + :vartype type: str + :param version: The version (revision) of the flow log. + :type version: int + """ + + _validation = { + 'type': {'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + } + + type = "JSON" + + def __init__( + self, + *, + version: Optional[int] = 0, + **kwargs + ): + super(FlowLogFormatParameters, self).__init__(**kwargs) + 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_06_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_06_01.models.RetentionPolicyParameters + :param format: Parameters that define the flow log format. + :type format: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.IPVersion + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.Subnet + :param public_ip_address: The reference to the Public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_01.models.PublicIPAddress + :param public_ip_prefix: The reference to the Public IP Prefix resource. + :type public_ip_prefix: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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: int + :ivar round_trip_time_avg: Average roundtrip time in milliseconds. + :vartype round_trip_time_avg: int + :ivar round_trip_time_max: Maximum roundtrip time in milliseconds. + :vartype round_trip_time_max: int + """ + + _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}, + 'round_trip_time_avg': {'readonly': True}, + 'round_trip_time_max': {'readonly': True}, + } + + _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': 'int'}, + 'round_trip_time_avg': {'key': 'properties.roundTripTimeAvg', 'type': 'int'}, + 'round_trip_time_max': {'key': 'properties.roundTripTimeMax', 'type': 'int'}, + } + + 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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar method: HTTP method. Default value: "Get". + :vartype method: str + :param headers: List of HTTP headers. + :type headers: list[~azure.mgmt.network.v2020_06_01.models.HTTPHeader] + :param valid_status_codes: Valid status codes. + :type valid_status_codes: list[int] + """ + + _validation = { + 'method': {'constant': True}, + } + + _attribute_map = { + 'method': {'key': 'method', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '[HTTPHeader]'}, + 'valid_status_codes': {'key': 'validStatusCodes', 'type': '[int]'}, + } + + method = "Get" + + def __init__( + self, + *, + headers: Optional[List["HTTPHeader"]] = None, + valid_status_codes: Optional[List[int]] = None, + **kwargs + ): + super(HTTPConfiguration, self).__init__(**kwargs) + 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_06_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_06_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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[~azure.mgmt.network.v2020_06_01.models.SubResource] + :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] + :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 + """ + + _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': '[SubResource]'}, + 'propagating_connections': {'key': 'properties.propagatingConnections', 'type': '[SubResource]'}, + '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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :ivar virtual_network: The VirtualNetwork that using the prefix of this IpAllocation resource. + :vartype virtual_network: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.Subnet + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.ProvisioningState + :param ip_addresses: IpAddresses/IpAddressPrefixes in the IpGroups resource. + :type ip_addresses: list[str] + :ivar firewalls: List of references to Azure resources that this IpGroups is associated with. + :vartype firewalls: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'firewalls': {'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]'}, + } + + 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 + + +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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference to the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param state: The state of peering. Possible values include: "Disabled", "Enabled". + :type state: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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 sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer. + :type probes: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.InboundNatPool] + :param outbound_rules: The outbound rules. + :type outbound_rules: list[~azure.mgmt.network.v2020_06_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_06_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}'}, + '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, + 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.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_06_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_06_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'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + virtual_network: Optional["SubResource"] = None, + ip_address: Optional[str] = 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 + + +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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "LoadBalancerSkuName"]] = None, + **kwargs + ): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = name + + +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_06_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_06_01.models.SubResource + :param probe: The reference to the load balancer probe used by the load balancing rule. + :type probe: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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. + + 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 rule_id: Required. Identifier for the managed rule. + :type rule_id: str + :ivar state: The state of the managed rule. Defaults to Disabled if not specified. Default + value: "Disabled". + :vartype state: str + """ + + _validation = { + 'rule_id': {'required': True}, + 'state': {'constant': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + state = "Disabled" + + def __init__( + self, + *, + rule_id: str, + **kwargs + ): + super(ManagedRuleOverride, self).__init__(**kwargs) + self.rule_id = rule_id + + +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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource] + :ivar subnets: An array of references to the subnets using this nat gateway resource. + :vartype subnets: list[~azure.mgmt.network.v2020_06_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_06_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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of Nat Gateway SKU. Default value: "Standard". + :vartype name: str + """ + + _validation = { + 'name': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "Standard" + + def __init__( + self, + **kwargs + ): + super(NatGatewaySku, self).__init__(**kwargs) + + +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_06_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_06_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] + """ + + _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]'}, + } + + 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, + **kwargs + ): + super(NatRule, self).__init__(name=name, description=description, **kwargs) + self.rule_type: str = 'NatRule' + 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 + + +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_06_01.models.VerbosityLevel + :param profiles: Required. List of network configuration diagnostic profiles. + :type profiles: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.NetworkConfigurationDiagnosticProfile + :param network_security_group_result: Network security group result. + :type network_security_group_result: + ~azure.mgmt.network.v2020_06_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_06_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] + :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_06_01.models.SubResource + :param network_security_group: The reference to the NetworkSecurityGroup resource. + :type network_security_group: ~azure.mgmt.network.v2020_06_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_06_01.models.PrivateEndpoint + :param ip_configurations: A list of IPConfigurations of the network interface. + :type ip_configurations: + list[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceIPConfiguration] + :ivar tap_configurations: A list of TapConfigurations of the network interface. + :vartype tap_configurations: + list[~azure.mgmt.network.v2020_06_01.models.NetworkInterfaceTapConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: ~azure.mgmt.network.v2020_06_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_06_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_06_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}'}, + '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, + 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.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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.ProvisioningState + :ivar private_link_connection_properties: PrivateLinkConnection properties for the network + interface. + :vartype private_link_connection_properties: + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.FirewallPolicyRuleType + :param ip_protocols: Array of FirewallPolicyRuleNetworkProtocols. + :type ip_protocols: list[str or + ~azure.mgmt.network.v2020_06_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: str = 'NetworkRule' + 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_06_01.models.SecurityRule] + :ivar default_security_rules: The default security rules of network security group. + :vartype default_security_rules: list[~azure.mgmt.network.v2020_06_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network interfaces. + :vartype network_interfaces: list[~azure.mgmt.network.v2020_06_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_06_01.models.Subnet] + :ivar flow_logs: A collection of references to flow log resources. + :vartype flow_logs: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.VirtualApplianceNicProperties] + :ivar virtual_appliance_sites: List of references to VirtualApplianceSite. + :vartype virtual_appliance_sites: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :ivar inbound_security_rules: List of references to InboundSecurityRules. + :vartype inbound_security_rules: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :ivar vpn_client_connection_health: All P2S VPN clients' connection health status. + :vartype vpn_client_connection_health: + ~azure.mgmt.network.v2020_06_01.models.VpnClientConnectionHealth + :param custom_dns_servers: List of all customer specified DNS servers IP addresses. + :type custom_dns_servers: list[str] + """ + + _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]'}, + } + + 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, + **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 + + +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_06_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_06_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_06_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + '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_06_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_06_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_06_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_06_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + '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_06_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_06_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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_06_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'etag': {'readonly': True}, + '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': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + '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: int + :param total_bytes_per_session: Maximum size of the capture output. + :type total_bytes_per_session: int + :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_06_01.models.PacketCaptureStorageLocation + :param filters: A list of packet capture filters. + :type filters: list[~azure.mgmt.network.v2020_06_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_06_01.models.ProvisioningState + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + '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_06_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. Default value: "Community". + :vartype route_filter_rule_type: str + :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_06_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'route_filter_rule_type': {'constant': 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'}, + } + + route_filter_rule_type = "Community" + + def __init__( + self, + *, + id: Optional[str] = None, + access: Optional[Union[str, "Access"]] = None, + communities: Optional[List[str]] = None, + **kwargs + ): + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.name = None + self.etag = None + self.access = access + 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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.WebApplicationFirewallEnabledState + :param mode: The mode of the policy. Possible values include: "Prevention", "Detection". + :type mode: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.PrivateLinkServiceConnection] + :param custom_dns_configs: An array of custom dns configurations. + :type custom_dns_configs: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.FrontendIPConfiguration] + :param ip_configurations: An array of private link service IP configurations. + :type ip_configurations: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.PrivateEndpointConnection] + :param visibility: The visibility list of the private link service. + :type visibility: ~azure.mgmt.network.v2020_06_01.models.ResourceSet + :param auto_approval: The auto-approval list of the private link service. + :type auto_approval: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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 sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP address. + :vartype ip_configuration: ~azure.mgmt.network.v2020_06_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_06_01.models.PublicIPAddressDnsSettings + :param ddos_settings: The DDoS protection custom policy associated with the public IP address. + :type ddos_settings: ~azure.mgmt.network.v2020_06_01.models.DdosSettings + :param ip_tags: The list of tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.network.v2020_06_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_06_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_06_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}'}, + '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, + 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.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_06_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_06_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "PublicIPAddressSkuName"]] = None, + **kwargs + ): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = name + + +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 sku: The public IP prefix SKU. + :type sku: ~azure.mgmt.network.v2020_06_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_06_01.models.IPVersion + :param ip_tags: The list of tags associated with the public IP prefix. + :type ip_tags: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.SubResource + :param custom_ip_prefix: The customIpPrefix that this prefix is associated with. + :type custom_ip_prefix: ~azure.mgmt.network.v2020_06_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_06_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}'}, + '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, + 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.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_06_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. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of a public IP prefix SKU. Default value: "Standard". + :vartype name: str + """ + + _validation = { + 'name': {'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + name = "Standard" + + def __init__( + self, + **kwargs + ): + super(PublicIPPrefixSku, self).__init__(**kwargs) + + +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_06_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_06_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_06_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_06_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_06_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_06_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit peerings. + :vartype peerings: list[~azure.mgmt.network.v2020_06_01.models.ExpressRouteCircuitPeering] + :ivar ipv6_peerings: A collection of references to express route circuit ipv6 peerings. + :vartype ipv6_peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.Access + :ivar route_filter_rule_type: The rule type of the rule. Default value: "Community". + :vartype route_filter_rule_type: str + :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_06_01.models.ProvisioningState + """ + + _validation = { + 'etag': {'readonly': True}, + 'route_filter_rule_type': {'constant': 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'}, + } + + route_filter_rule_type = "Community" + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + location: Optional[str] = None, + access: Optional[Union[str, "Access"]] = 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.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_06_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_06_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_06_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.SubResource + :param propagated_route_tables: The list of RouteTables to advertise the routes to. + :type propagated_route_tables: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SecurityPartnerProviderConnectionStatus + :param virtual_hub: The virtualHub to which the Security Partner Provider belongs. + :type virtual_hub: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.NetworkInterfaceAssociation + :param subnet_association: Subnet and it's custom security rules. + :type subnet_association: ~azure.mgmt.network.v2020_06_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_06_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.ServiceEndpointPolicyDefinition] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ServiceTagInformation] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'change_number': {'readonly': True}, + 'cloud': {'readonly': True}, + 'values': {'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]'}, + } + + 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 + + +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_06_01.models.NetworkSecurityGroup + :param route_table: The reference to the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2020_06_01.models.RouteTable + :param nat_gateway: Nat gateway associated with this subnet. + :type nat_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPropertiesFormat] + :param service_endpoint_policies: An array of service endpoint policies. + :type service_endpoint_policies: + list[~azure.mgmt.network.v2020_06_01.models.ServiceEndpointPolicy] + :ivar private_endpoints: An array of references to private endpoints. + :vartype private_endpoints: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.IPConfigurationProfile] + :param ip_allocations: Array of IpAllocation which reference this subnet. + :type ip_allocations: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.ServiceAssociationLink] + :param delegations: An array of references to the delegations on the subnet. + :type delegations: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param target_subnet: The reference to the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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 + :ivar unit: Required. An enum describing the unit of measurement. Default value: "Count". + :vartype unit: str + :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_06_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': 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'}, + } + + unit = "Count" + + def __init__( + self, + *, + current_value: int, + limit: int, + name: "UsageName", + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = None + 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_06_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_06_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values include: "TCP", "UDP". + :type protocol: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param vpn_gateway: The VpnGateway associated with this VirtualHub. + :type vpn_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param p2_s_vpn_gateway: The P2SVpnGateway associated with this VirtualHub. + :type p2_s_vpn_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param express_route_gateway: The expressRouteGateway associated with this VirtualHub. + :type express_route_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param azure_firewall: The azureFirewall associated with this VirtualHub. + :type azure_firewall: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param security_partner_provider: The securityPartnerProvider associated with this VirtualHub. + :type security_partner_provider: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_01.models.RoutingState + :ivar bgp_connections: List of references to Bgp Connections. + :vartype bgp_connections: list[~azure.mgmt.network.v2020_06_01.models.SubResource] + :ivar ip_configurations: List of references to IpConfigurations. + :vartype ip_configurations: list[~azure.mgmt.network.v2020_06_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 enable_virtual_router_route_propogation: Flag to control route propogation for + VirtualRouter hub. + :type enable_virtual_router_route_propogation: 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]'}, + 'enable_virtual_router_route_propogation': {'key': 'properties.enableVirtualRouterRoutePropogation', '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, + enable_virtual_router_route_propogation: 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.enable_virtual_router_route_propogation = enable_virtual_router_route_propogation + + +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_06_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_06_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_06_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_06_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] + :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_06_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_06_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2020_06_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01.models.VirtualNetworkBgpCommunities + :param ip_allocations: Array of IpAllocation which reference this VNET. + :type ip_allocations: list[~azure.mgmt.network.v2020_06_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}'}, + '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, + 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.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_06_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible values include: "Vpn", + "ExpressRoute". + :type gateway_type: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_06_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_06_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_06_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 + """ + + _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'}, + } + + 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, + **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 + + +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_06_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: ~azure.mgmt.network.v2020_06_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_06_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_06_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 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_06_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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'}, + '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, + 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.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_06_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2020_06_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.VirtualNetworkGatewayConnectionProtocol + :param routing_weight: The routing weight. + :type routing_weight: int + :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_06_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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'}, + '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, + 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.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_06_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_06_01.models.IPAllocationMethod + :param subnet: The reference to the subnet resource. + :type subnet: ~azure.mgmt.network.v2020_06_01.models.SubResource + :param public_ip_address: The reference to the public IP resource. + :type public_ip_address: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param remote_address_space: The reference to the remote virtual network address space. + :type remote_address_space: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param hosted_gateway: The Gateway on which VirtualRouter is hosted. + :type hosted_gateway: ~azure.mgmt.network.v2020_06_01.models.SubResource + :ivar peerings: List of references to VirtualRouterPeerings. + :vartype peerings: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource] + :ivar vpn_sites: List of VpnSites in the VirtualWAN. + :vartype vpn_sites: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network + gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.ProcessorArchitecture + :param authentication_method: VPN client authentication method. Possible values include: + "EAPTLS", "EAPMSCHAPv2". + :type authentication_method: str or ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.SubResource + :param connections: List of all vpn connections to the gateway. + :type connections: list[~azure.mgmt.network.v2020_06_01.models.VpnConnection] + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.VpnGatewayIpConfiguration] + """ + + _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]'}, + } + + 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, + **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 + + +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_06_01.models.VpnGatewayTunnelingProtocol] + :param vpn_authentication_types: VPN authentication types for the VpnServerConfiguration. + :type vpn_authentication_types: list[str or + ~azure.mgmt.network.v2020_06_01.models.VpnAuthenticationType] + :param vpn_client_root_certificates: VPN client root certificate of VpnServerConfiguration. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnServerConfigVpnClientRootCertificate] + :param vpn_client_revoked_certificates: VPN client revoked certificate of + VpnServerConfiguration. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnServerConfigVpnClientRevokedCertificate] + :param radius_server_root_certificates: Radius Server root certificate of + VpnServerConfiguration. + :type radius_server_root_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnServerConfigRadiusServerRootCertificate] + :param radius_client_root_certificates: Radius client root certificate of + VpnServerConfiguration. + :type radius_client_root_certificates: + list[~azure.mgmt.network.v2020_06_01.models.VpnServerConfigRadiusClientRootCertificate] + :param vpn_client_ipsec_policies: VpnClientIpsecPolicies for VpnServerConfiguration. + :type vpn_client_ipsec_policies: list[~azure.mgmt.network.v2020_06_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_06_01.models.RadiusServer] + :param aad_authentication_parameters: The set of aad vpn authentication parameters. + :type aad_authentication_parameters: + ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.SubResource + :param device_properties: The device properties. + :type device_properties: ~azure.mgmt.network.v2020_06_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_06_01.models.AddressSpace + :param bgp_properties: The set of bgp properties. + :type bgp_properties: ~azure.mgmt.network.v2020_06_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_06_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_06_01.models.VpnSiteLink] + :param o365_policy: Office365 Policy. + :type o365_policy: ~azure.mgmt.network.v2020_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_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_06_01.models.WebApplicationFirewallRuleType + :param match_conditions: Required. List of match conditions. + :type match_conditions: list[~azure.mgmt.network.v2020_06_01.models.MatchCondition] + :param action: Required. Type of Actions. Possible values include: "Allow", "Block", "Log". + :type action: str or ~azure.mgmt.network.v2020_06_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_06_01.models.PolicySettings + :param custom_rules: The custom rules inside the policy. + :type custom_rules: + list[~azure.mgmt.network.v2020_06_01.models.WebApplicationFirewallCustomRule] + :ivar application_gateways: A collection of references to application gateways. + :vartype application_gateways: list[~azure.mgmt.network.v2020_06_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_06_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_06_01.models.WebApplicationFirewallPolicyResourceState + :param managed_rules: Describes the managedRules structure. + :type managed_rules: ~azure.mgmt.network.v2020_06_01.models.ManagedRulesDefinition + :ivar http_listeners: A collection of references to application gateway http listeners. + :vartype http_listeners: list[~azure.mgmt.network.v2020_06_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_06_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_06_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_06_01/models/_network_management_client_enums.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_network_management_client_enums.py new file mode 100644 index 000000000000..5d8259805d5c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/models/_network_management_client_enums.py @@ -0,0 +1,1173 @@ +# 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 + +class Access(str, Enum): + """Access to be allowed or denied. + """ + + allow = "Allow" + deny = "Deny" + +class ApplicationGatewayBackendHealthServerHealth(str, Enum): + """Health of backend server. + """ + + unknown = "Unknown" + up = "Up" + down = "Down" + partial = "Partial" + draining = "Draining" + +class ApplicationGatewayCookieBasedAffinity(str, Enum): + """Cookie based affinity. + """ + + enabled = "Enabled" + disabled = "Disabled" + +class ApplicationGatewayCustomErrorStatusCode(str, Enum): + """Status code of the application gateway customer error. + """ + + http_status403 = "HttpStatus403" + http_status502 = "HttpStatus502" + +class ApplicationGatewayFirewallMode(str, Enum): + """Web application firewall mode. + """ + + detection = "Detection" + prevention = "Prevention" + +class ApplicationGatewayOperationalState(str, Enum): + """Operational state of the application gateway resource. + """ + + stopped = "Stopped" + starting = "Starting" + running = "Running" + stopping = "Stopping" + +class ApplicationGatewayProtocol(str, Enum): + """Application Gateway protocol. + """ + + http = "Http" + https = "Https" + +class ApplicationGatewayRedirectType(str, Enum): + """Redirect type enum. + """ + + permanent = "Permanent" + found = "Found" + see_other = "SeeOther" + temporary = "Temporary" + +class ApplicationGatewayRequestRoutingRuleType(str, Enum): + """Rule type. + """ + + basic = "Basic" + path_based_routing = "PathBasedRouting" + +class ApplicationGatewaySkuName(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(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(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(str, Enum): + """Type of Ssl Policy. + """ + + predefined = "Predefined" + custom = "Custom" + +class ApplicationGatewaySslProtocol(str, Enum): + """Ssl protocol enums. + """ + + tl_sv1_0 = "TLSv1_0" + tl_sv1_1 = "TLSv1_1" + tl_sv1_2 = "TLSv1_2" + +class ApplicationGatewayTier(str, Enum): + """Tier of an application gateway. + """ + + standard = "Standard" + waf = "WAF" + standard_v2 = "Standard_v2" + waf_v2 = "WAF_v2" + +class AssociationType(str, Enum): + """The association type of the child resource to the parent resource. + """ + + associated = "Associated" + contains = "Contains" + +class AuthenticationMethod(str, Enum): + """VPN client authentication method. + """ + + eaptls = "EAPTLS" + eapmscha_pv2 = "EAPMSCHAPv2" + +class AuthorizationUseStatus(str, Enum): + """The authorization use status. + """ + + available = "Available" + in_use = "InUse" + +class AzureFirewallApplicationRuleProtocolType(str, Enum): + """The protocol type of a Application Rule resource. + """ + + http = "Http" + https = "Https" + mssql = "Mssql" + +class AzureFirewallNatRCActionType(str, Enum): + """The action type of a NAT rule collection. + """ + + snat = "Snat" + dnat = "Dnat" + +class AzureFirewallNetworkRuleProtocol(str, Enum): + """The protocol of a Network Rule resource. + """ + + tcp = "TCP" + udp = "UDP" + any = "Any" + icmp = "ICMP" + +class AzureFirewallRCActionType(str, Enum): + """The action type of a rule collection. + """ + + allow = "Allow" + deny = "Deny" + +class AzureFirewallSkuName(str, Enum): + """Name of an Azure Firewall SKU. + """ + + azfw_vnet = "AZFW_VNet" + azfw_hub = "AZFW_Hub" + +class AzureFirewallSkuTier(str, Enum): + """Tier of an Azure Firewall. + """ + + standard = "Standard" + premium = "Premium" + +class AzureFirewallThreatIntelMode(str, Enum): + """The operation mode for Threat Intel. + """ + + alert = "Alert" + deny = "Deny" + off = "Off" + +class BastionConnectProtocol(str, Enum): + """The protocol used to connect to the target. + """ + + ssh = "SSH" + rdp = "RDP" + +class BgpPeerState(str, Enum): + """The BGP peer state. + """ + + unknown = "Unknown" + stopped = "Stopped" + idle = "Idle" + connecting = "Connecting" + connected = "Connected" + +class CircuitConnectionStatus(str, Enum): + """Express Route Circuit connection state. + """ + + connected = "Connected" + connecting = "Connecting" + disconnected = "Disconnected" + +class CommissionedState(str, Enum): + """The commissioned state of the Custom IP Prefix. + """ + + provisioning = "Provisioning" + provisioned = "Provisioned" + commissioning = "Commissioning" + commissioned = "Commissioned" + decommissioning = "Decommissioning" + deprovisioning = "Deprovisioning" + +class ConnectionMonitorSourceStatus(str, Enum): + """Status of connection monitor source. + """ + + unknown = "Unknown" + active = "Active" + inactive = "Inactive" + +class ConnectionMonitorTestConfigurationProtocol(str, Enum): + """The protocol to use in test evaluation. + """ + + tcp = "Tcp" + http = "Http" + icmp = "Icmp" + +class ConnectionMonitorType(str, Enum): + """Type of connection monitor. + """ + + multi_endpoint = "MultiEndpoint" + single_source_destination = "SingleSourceDestination" + +class ConnectionState(str, Enum): + """The connection state. + """ + + reachable = "Reachable" + unreachable = "Unreachable" + unknown = "Unknown" + +class ConnectionStatus(str, Enum): + """The connection status. + """ + + unknown = "Unknown" + connected = "Connected" + disconnected = "Disconnected" + degraded = "Degraded" + +class CoverageLevel(str, Enum): + """Test coverage for the endpoint. + """ + + default = "Default" + low = "Low" + below_average = "BelowAverage" + average = "Average" + above_average = "AboveAverage" + full = "Full" + +class DdosCustomPolicyProtocol(str, Enum): + """The protocol for which the DDoS protection policy is being customized. + """ + + tcp = "Tcp" + udp = "Udp" + syn = "Syn" + +class DdosCustomPolicyTriggerSensitivityOverride(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(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(str, Enum): + """Destination port behavior. + """ + + none = "None" + listen_if_available = "ListenIfAvailable" + +class DhGroup(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(str, Enum): + """The direction of the traffic. + """ + + inbound = "Inbound" + outbound = "Outbound" + +class EffectiveRouteSource(str, Enum): + """Who created the route. + """ + + unknown = "Unknown" + user = "User" + virtual_network_gateway = "VirtualNetworkGateway" + default = "Default" + +class EffectiveRouteState(str, Enum): + """The value of effective route. + """ + + active = "Active" + invalid = "Invalid" + +class EffectiveSecurityRuleProtocol(str, Enum): + """The network protocol this rule applies to. + """ + + tcp = "Tcp" + udp = "Udp" + all = "All" + +class EndpointType(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(str, Enum): + """Connectivity analysis evaluation state. + """ + + not_started = "NotStarted" + in_progress = "InProgress" + completed = "Completed" + +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): + """The advertised public prefix state of the Peering resource. + """ + + not_configured = "NotConfigured" + configuring = "Configuring" + configured = "Configured" + validation_needed = "ValidationNeeded" + +class ExpressRouteCircuitPeeringState(str, Enum): + """The state of peering. + """ + + disabled = "Disabled" + enabled = "Enabled" + +class ExpressRouteCircuitSkuFamily(str, Enum): + """The family of the SKU. + """ + + unlimited_data = "UnlimitedData" + metered_data = "MeteredData" + +class ExpressRouteCircuitSkuTier(str, Enum): + """The tier of the SKU. + """ + + standard = "Standard" + premium = "Premium" + basic = "Basic" + local = "Local" + +class ExpressRouteLinkAdminState(str, Enum): + """Administrative state of the physical port. + """ + + enabled = "Enabled" + disabled = "Disabled" + +class ExpressRouteLinkConnectorType(str, Enum): + """Physical fiber port type. + """ + + lc = "LC" + sc = "SC" + +class ExpressRouteLinkMacSecCipher(str, Enum): + """Mac security cipher. + """ + + gcm_aes256 = "GcmAes256" + gcm_aes128 = "GcmAes128" + gcm_aes_xpn128 = "GcmAesXpn128" + gcm_aes_xpn256 = "GcmAesXpn256" + +class ExpressRouteLinkMacSecSciState(str, Enum): + """Sci mode enabled/disabled. + """ + + disabled = "Disabled" + enabled = "Enabled" + +class ExpressRoutePeeringState(str, Enum): + """The state of peering. + """ + + disabled = "Disabled" + enabled = "Enabled" + +class ExpressRoutePeeringType(str, Enum): + """The peering type. + """ + + azure_public_peering = "AzurePublicPeering" + azure_private_peering = "AzurePrivatePeering" + microsoft_peering = "MicrosoftPeering" + +class ExpressRoutePortsEncapsulation(str, Enum): + """Encapsulation method on physical ports. + """ + + dot1_q = "Dot1Q" + qin_q = "QinQ" + +class FirewallPolicyFilterRuleCollectionActionType(str, Enum): + """The action type of a rule. + """ + + allow = "Allow" + deny = "Deny" + +class FirewallPolicyRuleApplicationProtocolType(str, Enum): + """The application protocol type of a Rule. + """ + + http = "Http" + https = "Https" + +class FirewallPolicyRuleCollectionType(str, Enum): + """The type of the rule collection. + """ + + firewall_policy_nat_rule_collection = "FirewallPolicyNatRuleCollection" + firewall_policy_filter_rule_collection = "FirewallPolicyFilterRuleCollection" + +class FirewallPolicyRuleNetworkProtocol(str, Enum): + """The Network protocol of a Rule. + """ + + tcp = "TCP" + udp = "UDP" + any = "Any" + icmp = "ICMP" + +class FirewallPolicyRuleType(str, Enum): + """Rule Type. + """ + + application_rule = "ApplicationRule" + network_rule = "NetworkRule" + nat_rule = "NatRule" + +class HTTPConfigurationMethod(str, Enum): + """The HTTP method to use. + """ + + get = "Get" + post = "Post" + +class HubBgpConnectionStatus(str, Enum): + """The current state of the VirtualHub to Peer. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class HubVirtualNetworkConnectionStatus(str, Enum): + """The current state of the VirtualHub to vnet connection. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class IkeEncryption(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(str, Enum): + """The IKE integrity algorithm (IKE phase 2). + """ + + md5 = "MD5" + sha1 = "SHA1" + sha256 = "SHA256" + sha384 = "SHA384" + gcmaes256 = "GCMAES256" + gcmaes128 = "GCMAES128" + +class InboundSecurityRulesProtocol(str, Enum): + """Protocol. This should be either TCP or UDP. + """ + + tcp = "TCP" + udp = "UDP" + +class IPAllocationMethod(str, Enum): + """IP address allocation method. + """ + + static = "Static" + dynamic = "Dynamic" + +class IpAllocationType(str, Enum): + """IpAllocation type. + """ + + undefined = "Undefined" + hypernet = "Hypernet" + +class IpFlowProtocol(str, Enum): + """Protocol to be verified on. + """ + + tcp = "TCP" + udp = "UDP" + +class IpsecEncryption(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(str, Enum): + """The IPSec integrity algorithm (IKE phase 1). + """ + + md5 = "MD5" + sha1 = "SHA1" + sha256 = "SHA256" + gcmaes128 = "GCMAES128" + gcmaes192 = "GCMAES192" + gcmaes256 = "GCMAES256" + +class IPVersion(str, Enum): + """IP address version. + """ + + i_pv4 = "IPv4" + i_pv6 = "IPv6" + +class IssueType(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(str, Enum): + """The protocol for the outbound rule in load balancer. + """ + + tcp = "Tcp" + udp = "Udp" + all = "All" + +class LoadBalancerSkuName(str, Enum): + """Name of a load balancer SKU. + """ + + basic = "Basic" + standard = "Standard" + +class LoadDistribution(str, Enum): + """The load distribution policy for this rule. + """ + + default = "Default" + source_ip = "SourceIP" + source_ip_protocol = "SourceIPProtocol" + +class NetworkOperationStatus(str, Enum): + """Status of the Azure async operation. + """ + + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + +class NextHopType(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(str, Enum): + """The office traffic category. + """ + + optimize = "Optimize" + optimize_and_allow = "OptimizeAndAllow" + all = "All" + none = "None" + +class Origin(str, Enum): + """The origin of the issue. + """ + + local = "Local" + inbound = "Inbound" + outbound = "Outbound" + +class OwaspCrsExclusionEntryMatchVariable(str, Enum): + """The variable to be excluded. + """ + + request_header_names = "RequestHeaderNames" + request_cookie_names = "RequestCookieNames" + request_arg_names = "RequestArgNames" + +class OwaspCrsExclusionEntrySelectorMatchOperator(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(str, Enum): + + internal_error = "InternalError" + agent_stopped = "AgentStopped" + capture_failed = "CaptureFailed" + local_file_failed = "LocalFileFailed" + storage_failed = "StorageFailed" + +class PcProtocol(str, Enum): + """Protocol to be filtered on. + """ + + tcp = "TCP" + udp = "UDP" + any = "Any" + +class PcStatus(str, Enum): + """The status of the packet capture session. + """ + + not_started = "NotStarted" + running = "Running" + stopped = "Stopped" + error = "Error" + unknown = "Unknown" + +class PfsGroup(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(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(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(str, Enum): + """VPN client Processor Architecture. + """ + + amd64 = "Amd64" + x86 = "X86" + +class Protocol(str, Enum): + """Network protocol. + """ + + tcp = "Tcp" + http = "Http" + https = "Https" + icmp = "Icmp" + +class ProtocolType(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(str, Enum): + """The current provisioning state. + """ + + succeeded = "Succeeded" + updating = "Updating" + deleting = "Deleting" + failed = "Failed" + +class PublicIPAddressSkuName(str, Enum): + """Name of a public IP address SKU. + """ + + basic = "Basic" + standard = "Standard" + +class ResourceIdentityType(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 RouteNextHopType(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(str, Enum): + """The current routing state of the VirtualHub. + """ + + none = "None" + provisioned = "Provisioned" + provisioning = "Provisioning" + failed = "Failed" + +class SecurityPartnerProviderConnectionStatus(str, Enum): + """The current state of the connection with Security Partner Provider. + """ + + unknown = "Unknown" + partially_connected = "PartiallyConnected" + connected = "Connected" + not_connected = "NotConnected" + +class SecurityProviderName(str, Enum): + """The Security Providers. + """ + + z_scaler = "ZScaler" + i_boss = "IBoss" + checkpoint = "Checkpoint" + +class SecurityRuleAccess(str, Enum): + """Whether network traffic is allowed or denied. + """ + + allow = "Allow" + deny = "Deny" + +class SecurityRuleDirection(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(str, Enum): + """Network protocol this rule applies to. + """ + + tcp = "Tcp" + udp = "Udp" + icmp = "Icmp" + esp = "Esp" + asterisk = "*" + ah = "Ah" + +class ServiceProviderProvisioningState(str, Enum): + """The ServiceProviderProvisioningState state of the resource. + """ + + not_provisioned = "NotProvisioned" + provisioning = "Provisioning" + provisioned = "Provisioned" + deprovisioning = "Deprovisioning" + +class Severity(str, Enum): + """The severity of the issue. + """ + + error = "Error" + warning = "Warning" + +class TransportProtocol(str, Enum): + """The transport protocol for the endpoint. + """ + + udp = "Udp" + tcp = "Tcp" + all = "All" + +class TunnelConnectionStatus(str, Enum): + """The current state of the tunnel. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class VerbosityLevel(str, Enum): + """Verbosity level. + """ + + normal = "Normal" + minimum = "Minimum" + full = "Full" + +class VirtualNetworkGatewayConnectionProtocol(str, Enum): + """Gateway connection protocol. + """ + + ik_ev2 = "IKEv2" + ik_ev1 = "IKEv1" + +class VirtualNetworkGatewayConnectionStatus(str, Enum): + """Virtual Network Gateway connection status. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class VirtualNetworkGatewayConnectionType(str, Enum): + """Gateway connection type. + """ + + i_psec = "IPsec" + vnet2_vnet = "Vnet2Vnet" + express_route = "ExpressRoute" + vpn_client = "VPNClient" + +class VirtualNetworkGatewaySkuName(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(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(str, Enum): + """The type of this virtual network gateway. + """ + + vpn = "Vpn" + express_route = "ExpressRoute" + +class VirtualNetworkPeeringState(str, Enum): + """The status of the virtual network peering. + """ + + initiated = "Initiated" + connected = "Connected" + disconnected = "Disconnected" + +class VirtualWanSecurityProviderType(str, Enum): + """The virtual wan security provider type. + """ + + external = "External" + native = "Native" + +class VpnAuthenticationType(str, Enum): + """VPN authentication types enabled for the VpnServerConfiguration. + """ + + certificate = "Certificate" + radius = "Radius" + aad = "AAD" + +class VpnClientProtocol(str, Enum): + """VPN client protocol enabled for the virtual network gateway. + """ + + ike_v2 = "IkeV2" + sstp = "SSTP" + open_vpn = "OpenVPN" + +class VpnConnectionStatus(str, Enum): + """The current state of the vpn connection. + """ + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + +class VpnGatewayGeneration(str, Enum): + """The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. + """ + + none = "None" + generation1 = "Generation1" + generation2 = "Generation2" + +class VpnGatewayTunnelingProtocol(str, Enum): + """VPN protocol enabled for the VpnServerConfiguration. + """ + + ike_v2 = "IkeV2" + open_vpn = "OpenVPN" + +class VpnType(str, Enum): + """The type of this virtual network gateway. + """ + + policy_based = "PolicyBased" + route_based = "RouteBased" + +class WebApplicationFirewallAction(str, Enum): + """Type of Actions. + """ + + allow = "Allow" + block = "Block" + log = "Log" + +class WebApplicationFirewallEnabledState(str, Enum): + """The state of the policy. + """ + + disabled = "Disabled" + enabled = "Enabled" + +class WebApplicationFirewallMatchVariable(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(str, Enum): + """The mode of the policy. + """ + + prevention = "Prevention" + detection = "Detection" + +class WebApplicationFirewallOperator(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(str, Enum): + """Resource status of the policy. + """ + + creating = "Creating" + enabling = "Enabling" + enabled = "Enabled" + disabling = "Disabling" + disabled = "Disabled" + deleting = "Deleting" + +class WebApplicationFirewallRuleType(str, Enum): + """The rule type. + """ + + match_rule = "MatchRule" + invalid = "Invalid" + +class WebApplicationFirewallTransform(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_06_01/operations/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/__init__.py new file mode 100644 index 000000000000..8c6fe1ec8a6e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/__init__.py @@ -0,0 +1,221 @@ +# 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 ._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', + '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_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 new file mode 100644 index 000000000000..588f5587c6c2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_endpoint_connections_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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ApplicationGatewayPrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayPrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateEndpointConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8f519cc6eb02 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateway_private_link_resources_operations.py @@ -0,0 +1,118 @@ +# 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 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 + +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_06_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_06_01.models.ApplicationGatewayPrivateLinkResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayPrivateLinkResourceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateways_operations.py new file mode 100644 index 000000000000..62615ab5041b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_gateways_operations.py @@ -0,0 +1,1326 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ApplicationGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ApplicationGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayAvailableWafRuleSetsResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableWafRuleSetsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayAvailableSslOptions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslOptions"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewayAvailableSslPredefinedPolicies"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ApplicationGatewaySslPredefinedPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationGatewaySslPredefinedPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..1272be0a9872 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_application_security_groups_operations.py @@ -0,0 +1,524 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ApplicationSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ApplicationSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApplicationSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_available_delegations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_delegations_operations.py new file mode 100644 index 000000000000..9e0a9c191d84 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_delegations_operations.py @@ -0,0 +1,114 @@ +# 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 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 + +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_06_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_06_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..34cf5467e981 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_endpoint_services_operations.py @@ -0,0 +1,114 @@ +# 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 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 + +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_06_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_06_01.models.EndpointServicesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EndpointServicesListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..ada0bcfad6fc --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.AvailablePrivateEndpointTypesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailablePrivateEndpointTypesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..71f04e9a4b93 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_available_resource_group_delegations_operations.py @@ -0,0 +1,118 @@ +# 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 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 + +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_06_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_06_01.models.AvailableDelegationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableDelegationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..9d9c5906dd8f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.AvailableServiceAliasesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableServiceAliasesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..68194f83b21d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewall_fqdn_tags_operations.py @@ -0,0 +1,110 @@ +# 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 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 + +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_06_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_06_01.models.AzureFirewallFqdnTagListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallFqdnTagListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_azure_firewalls_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewalls_operations.py new file mode 100644 index 000000000000..a3b0dfec59f3 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_azure_firewalls_operations.py @@ -0,0 +1,578 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.AzureFirewall + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewall"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.AzureFirewallListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AzureFirewallListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_bastion_hosts_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bastion_hosts_operations.py new file mode 100644 index 000000000000..1e32633b5567 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bastion_hosts_operations.py @@ -0,0 +1,458 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.BastionHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHost"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.BastionHostListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionHostListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..12f14c50698f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_bgp_service_communities_operations.py @@ -0,0 +1,110 @@ +# 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 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 + +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_06_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_06_01.models.BgpServiceCommunityListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BgpServiceCommunityListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_connection_monitors_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_connection_monitors_operations.py new file mode 100644 index 000000000000..41341ee89f27 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_connection_monitors_operations.py @@ -0,0 +1,820 @@ +# 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 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 + +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_06_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" + **kwargs # type: Any + ): + # type: (...) -> "models.ConnectionMonitorResult" + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + 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" + **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_06_01.models.ConnectionMonitor + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :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_06_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, + 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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.ConnectionMonitorResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ConnectionMonitorListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionMonitorListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..a87df75b1bd2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_custom_ip_prefixes_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.CustomIpPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.CustomIpPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.CustomIpPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.CustomIpPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CustomIpPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..50a4ebef9644 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_custom_policies_operations.py @@ -0,0 +1,390 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.DdosCustomPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosCustomPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..b5d65ca4e6b7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ddos_protection_plans_operations.py @@ -0,0 +1,523 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.DdosProtectionPlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlan"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.DdosProtectionPlanListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DdosProtectionPlanListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..27918d8d01d8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/operations/_dscp_configuration_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_dscp_configuration_operations.py new file mode 100644 index 000000000000..b440bc284ec1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_dscp_configuration_operations.py @@ -0,0 +1,458 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.DscpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.DscpConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.DscpConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DscpConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..eb03a1262987 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_authorizations_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuitAuthorization + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitAuthorization"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.AuthorizationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..33357963efdd --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_connections_operations.py @@ -0,0 +1,437 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..4894fa77c999 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuit_peerings_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuitPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ExpressRouteCircuitPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..3292a2e95c3e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuits_operations.py @@ -0,0 +1,1005 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ExpressRouteCircuit + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuit"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ExpressRouteCircuitStats + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitStats"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRouteCircuitListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCircuitListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..07c0656d940f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_connections_operations.py @@ -0,0 +1,398 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ExpressRouteConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteConnectionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteConnectionList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..739d849e0e3a --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connection_peerings_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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_06_01.models.ExpressRouteCrossConnectionPeeringList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeeringList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRouteCrossConnectionPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_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 new file mode 100644 index 000000000000..cfa3da273763 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_cross_connections_operations.py @@ -0,0 +1,787 @@ +# 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 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 + +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_06_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_06_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRouteCrossConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ExpressRouteCrossConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteCrossConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..41c1b8840cb0 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_gateways_operations.py @@ -0,0 +1,427 @@ +# 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 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 + +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_06_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_06_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ExpressRouteGatewayList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGatewayList"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ExpressRouteGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..f4e3a8939181 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.ExpressRouteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLink"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ExpressRouteLinkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteLinkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8c42ecfb5ccf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.ExpressRoutePortsLocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRoutePortsLocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortsLocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8fc2fd6e3c20 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_ports_operations.py @@ -0,0 +1,588 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ExpressRoutePort + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePort"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ExpressRoutePortListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRoutePortListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_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_06_01.models.GenerateExpressRoutePortsLOAResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.GenerateExpressRoutePortsLOAResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..9434cd0fbd26 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_service_providers_operations.py @@ -0,0 +1,110 @@ +# 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 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 + +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_06_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_06_01.models.ExpressRouteServiceProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressRouteServiceProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_firewall_policies_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policies_operations.py new file mode 100644 index 000000000000..de134dd0bf8f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policies_operations.py @@ -0,0 +1,463 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.FirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.FirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..4507a69dfd5e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_firewall_policy_rule_collection_groups_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.FirewallPolicyRuleCollectionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.FirewallPolicyRuleCollectionGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FirewallPolicyRuleCollectionGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_flow_logs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_flow_logs_operations.py new file mode 100644 index 000000000000..816522ec4e80 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_flow_logs_operations.py @@ -0,0 +1,488 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.FlowLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLog"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.FlowLogListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FlowLogListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..0237d9cc2ac4 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_route_tables_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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.HubRouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubRouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListHubRouteTablesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubRouteTablesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..7131485d155e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_hub_virtual_network_connections_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.HubVirtualNetworkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubVirtualNetworkConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ListHubVirtualNetworkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListHubVirtualNetworkConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..1e0d7e8f0a9d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_nat_rules_operations.py @@ -0,0 +1,420 @@ +# 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 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 + +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_06_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_06_01.models.InboundNatRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.InboundNatRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InboundNatRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_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 new file mode 100644 index 000000000000..40ed263226f8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_inbound_security_rule_operations.py @@ -0,0 +1,176 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01/operations/_ip_allocations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_allocations_operations.py new file mode 100644 index 000000000000..46d48e49c910 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_allocations_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.IpAllocation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocation"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.IpAllocationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpAllocationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_ip_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_groups_operations.py new file mode 100644 index 000000000000..e71e1bf487f6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_ip_groups_operations.py @@ -0,0 +1,535 @@ +# 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 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 + +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_06_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_06_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.IpGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.IpGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IpGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..b41b6a574dac --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_backend_address_pools_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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_06_01.models.LoadBalancerBackendAddressPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerBackendAddressPoolListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.BackendAddressPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BackendAddressPool"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..f3cdc6abaa5d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.LoadBalancerFrontendIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerFrontendIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.FrontendIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FrontendIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..bd836c3a3eaa --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.LoadBalancerLoadBalancingRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerLoadBalancingRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.LoadBalancingRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancingRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..e3a95ed45894 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancer_network_interfaces_operations.py @@ -0,0 +1,118 @@ +# 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 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 + +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_06_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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8bac2ed9853f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.LoadBalancerOutboundRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerOutboundRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.OutboundRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OutboundRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8f86c31651b9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.LoadBalancerProbeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerProbeListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.Probe + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Probe"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancers_operations.py new file mode 100644 index 000000000000..22d3ae117e2c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_load_balancers_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.LoadBalancer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancer"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.LoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..86a1fa94db0e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_local_network_gateways_operations.py @@ -0,0 +1,459 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.LocalNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.LocalNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LocalNetworkGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_nat_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_nat_gateways_operations.py new file mode 100644 index 000000000000..6f14eb529d02 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_nat_gateways_operations.py @@ -0,0 +1,531 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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: (...) -> "models.NatGateway" + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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) + + 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, {}) + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.NatGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NatGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NatGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..875ec8fe2e58 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..3ee00f1d1108 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_load_balancers_operations.py @@ -0,0 +1,118 @@ +# 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 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 + +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_06_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_06_01.models.NetworkInterfaceLoadBalancerListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceLoadBalancerListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..9f1d8cde2918 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interface_tap_configurations_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkInterfaceTapConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.NetworkInterfaceTapConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceTapConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interfaces_operations.py new file mode 100644 index 000000000000..377ac6a58d1c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_interfaces_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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterfaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterface + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterface"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_06_01.models.NetworkInterfaceIPConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfigurationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkInterfaceIPConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkInterfaceIPConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..4379ad4c3082 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_management_client_operations.py @@ -0,0 +1,775 @@ +# 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 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 + +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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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["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_06_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 BastionShareableLinkListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_06_01.models.BastionShareableLinkListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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): + deserialized = self._deserialize('BastionShareableLinkListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionShareableLinkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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["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 either BastionActiveSessionListResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_06_01.models.BastionActiveSessionListResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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): + deserialized = self._deserialize('BastionActiveSessionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BastionSessionDeleteResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = "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'] = 'application/json' + + 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_06_01.models.DnsNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DnsNameAvailabilityResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.VirtualWanSecurityProviders + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWanSecurityProviders"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/operations/_network_profiles_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_profiles_operations.py new file mode 100644 index 000000000000..d1327f6b79df --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_profiles_operations.py @@ -0,0 +1,475 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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_06_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_01.models.NetworkProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfile"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkProfileListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkProfileListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..e9f54241a0a9 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_security_groups_operations.py @@ -0,0 +1,529 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.NetworkSecurityGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkSecurityGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkSecurityGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..1f7a52fd24ea --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_virtual_appliances_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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_06_01.models.NetworkVirtualAppliance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualAppliance"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkVirtualApplianceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_watchers_operations.py new file mode 100644 index 000000000000..5996a5ffe490 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_network_watchers_operations.py @@ -0,0 +1,1904 @@ +# 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 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 + +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_06_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_06_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_06_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.NetworkWatcher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcher"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkWatcherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkWatcherListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_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_06_01.models.Topology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Topology"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/operations/_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_operations.py new file mode 100644 index 000000000000..97c7f5dc3986 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_operations.py @@ -0,0 +1,106 @@ +# 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 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 + +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_06_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_06_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..17b854fda22c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_p2_svpn_gateways_operations.py @@ -0,0 +1,1153 @@ +# 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 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 + +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_06_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_06_01.models.P2SVpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.P2SVpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListP2SVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListP2SVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_packet_captures_operations.py new file mode 100644 index 000000000000..6368869f1cfb --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_packet_captures_operations.py @@ -0,0 +1,639 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.PacketCaptureResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PacketCaptureListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PacketCaptureListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..241ca7d7eb54 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.PeerExpressRouteCircuitConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.PeerExpressRouteCircuitConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PeerExpressRouteCircuitConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..e7fec7363d79 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_dns_zone_groups_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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PrivateDnsZoneGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroup"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.PrivateDnsZoneGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateDnsZoneGroupListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_private_endpoints_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_endpoints_operations.py new file mode 100644 index 000000000000..28163caa8e83 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_endpoints_operations.py @@ -0,0 +1,468 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PrivateEndpoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpoint"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PrivateEndpointListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..01af0a8acd1c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_private_link_services_operations.py @@ -0,0 +1,1162 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PrivateLinkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkService"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PrivateLinkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkServiceListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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_06_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.AutoApprovedPrivateLinkServicesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AutoApprovedPrivateLinkServicesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..44f127ef89a6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_addresses_operations.py @@ -0,0 +1,762 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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 subnet. + :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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 subnet. + :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_06_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPAddressListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddressListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPAddress + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPAddress"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-10-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..58e3de6ebb8c --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_public_ip_prefixes_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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_06_01.models.PublicIPPrefix + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefix"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.PublicIPPrefixListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PublicIPPrefixListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..61d737bf8c99 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_resource_navigation_links_operations.py @@ -0,0 +1,105 @@ +# 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 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 + +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_06_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_06_01.models.ResourceNavigationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceNavigationLinksListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..cf9e9a5329c6 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filter_rules_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.RouteFilterRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.RouteFilterRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filters_operations.py new file mode 100644 index 000000000000..ac6c2acc19dd --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_filters_operations.py @@ -0,0 +1,529 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.RouteFilter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.RouteFilterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteFilterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_tables_operations.py new file mode 100644 index 000000000000..f3ef163df2f5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_route_tables_operations.py @@ -0,0 +1,528 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.RouteTable + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTable"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.RouteTableListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteTableListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_routes_operations.py new file mode 100644 index 000000000000..2a14b8d73500 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_routes_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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.Route + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Route"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.RouteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RouteListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..e5ec754ed9ce --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_partner_providers_operations.py @@ -0,0 +1,524 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.SecurityPartnerProvider + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProvider"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.SecurityPartnerProviderListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityPartnerProviderListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_rules_operations.py new file mode 100644 index 000000000000..a1e3dcdd0547 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_security_rules_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.SecurityRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRule"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.SecurityRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SecurityRuleListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..950b56c34034 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_association_links_operations.py @@ -0,0 +1,105 @@ +# 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 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 + +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_06_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_06_01.models.ServiceAssociationLinksListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceAssociationLinksListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..8b785b6c4ed1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policies_operations.py @@ -0,0 +1,529 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.ServiceEndpointPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ServiceEndpointPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..1f99853882f7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_endpoint_policy_definitions_operations.py @@ -0,0 +1,419 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ServiceEndpointPolicyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinition"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ServiceEndpointPolicyDefinitionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceEndpointPolicyDefinitionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_service_tags_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_tags_operations.py new file mode 100644 index 000000000000..f1041d83a7ba --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_service_tags_operations.py @@ -0,0 +1,99 @@ +# 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 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 + +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_06_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_06_01.models.ServiceTagsListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceTagsListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_subnets_operations.py new file mode 100644 index 000000000000..69d8a840c88f --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_subnets_operations.py @@ -0,0 +1,655 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.Subnet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Subnet"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.SubnetListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubnetListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_usages_operations.py new file mode 100644 index 000000000000..ff394a7215b7 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_usages_operations.py @@ -0,0 +1,114 @@ +# 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 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 + +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_06_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_06_01.models.UsagesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..33929eca362e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_appliance_sites_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualApplianceSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualApplianceSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.NetworkVirtualApplianceSiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSiteListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..ac6848465100 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.NetworkVirtualApplianceSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSkuListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.NetworkVirtualApplianceSku + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkVirtualApplianceSku"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..f6cfcd150477 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connection_operations.py @@ -0,0 +1,342 @@ +# 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 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 + +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_06_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_06_01.models.BgpConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BgpConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..d829ce9f9853 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_bgp_connections_operations.py @@ -0,0 +1,350 @@ +# 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 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 + +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_06_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_06_01.models.ListVirtualHubBgpConnectionResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubBgpConnectionResults"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..5a1a5fd8ecc3 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_ip_configuration_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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_06_01.models.HubIpConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.HubIpConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVirtualHubIpConfigurationResults] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubIpConfigurationResults"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..e1f1aa4ba615 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hub_route_table_v2_s_operations.py @@ -0,0 +1,419 @@ +# 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 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 + +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_06_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_06_01.models.VirtualHubRouteTableV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHubRouteTableV2"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVirtualHubRouteTableV2SResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubRouteTableV2SResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_virtual_hubs_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hubs_operations.py new file mode 100644 index 000000000000..97f5f2eea26d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_hubs_operations.py @@ -0,0 +1,638 @@ +# 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 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 + +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_06_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_06_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VirtualHub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualHub"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVirtualHubsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualHubsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..4284a28f17cd --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateway_connections_operations.py @@ -0,0 +1,1076 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualNetworkGatewayConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.ConnectionSharedKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConnectionSharedKey"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.VirtualNetworkGatewayConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayConnectionListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..6f2aa432b8b3 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_gateways_operations.py @@ -0,0 +1,2321 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualNetworkGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualNetworkGatewayListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.VirtualNetworkGatewayListConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkGatewayListConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..485bd1d5bc21 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_peerings_operations.py @@ -0,0 +1,415 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualNetworkPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualNetworkPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..f705807ea475 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_network_taps_operations.py @@ -0,0 +1,523 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VirtualNetworkTap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTap"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.VirtualNetworkTapListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkTapListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_networks_operations.py new file mode 100644 index 000000000000..6acf6c156a84 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_networks_operations.py @@ -0,0 +1,660 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetwork"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.VirtualNetworkListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.IPAddressAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IPAddressAvailabilityResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.VirtualNetworkListUsageResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkListUsageResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..e0546fc8a906 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_router_peerings_operations.py @@ -0,0 +1,419 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualRouterPeering + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeering"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualRouterPeeringListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterPeeringListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_virtual_routers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_routers_operations.py new file mode 100644 index 000000000000..e835b80c9a07 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_routers_operations.py @@ -0,0 +1,468 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.VirtualRouter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouter"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.VirtualRouterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualRouterListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_virtual_wans_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_wans_operations.py new file mode 100644 index 000000000000..b05d063f69e5 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_virtual_wans_operations.py @@ -0,0 +1,523 @@ +# 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 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 + +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_06_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_06_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VirtualWAN + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualWAN"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVirtualWANsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVirtualWANsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_vpn_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_connections_operations.py new file mode 100644 index 000000000000..bafd0f93450b --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_connections_operations.py @@ -0,0 +1,675 @@ +# 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 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 + +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_06_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_06_01.models.VpnConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVpnConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01/operations/_vpn_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_gateways_operations.py new file mode 100644 index 000000000000..9d1d0cf2fff2 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_gateways_operations.py @@ -0,0 +1,936 @@ +# 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 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 + +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_06_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_06_01.models.VpnGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnGateway"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVpnGatewaysResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnGatewaysResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..631b934a3f64 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_link_connections_operations.py @@ -0,0 +1,123 @@ +# 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 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 + +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_06_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_06_01.models.ListVpnSiteLinkConnectionsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinkConnectionsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..38f0bc80cdef --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_associated_with_virtual_wan_operations.py @@ -0,0 +1,157 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_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 new file mode 100644 index 000000000000..8af580d67461 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_server_configurations_operations.py @@ -0,0 +1,527 @@ +# 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 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 + +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_06_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_06_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VpnServerConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnServerConfiguration"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVpnServerConfigurationsResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnServerConfigurationsResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..901ac9b16c1e --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_site_link_connections_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 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 + +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_06_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_06_01.models.VpnSiteLinkConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLinkConnection"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..d712e8e6aa34 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/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 TYPE_CHECKING +import warnings + +from azure.core.exceptions import 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 + +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_06_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_06_01.models.VpnSiteLink + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSiteLink"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_01.models.ListVpnSiteLinksResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSiteLinksResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..a7f240dcfc10 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_configuration_operations.py @@ -0,0 +1,159 @@ +# 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 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 + +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_06_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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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') + + 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_06_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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/operations/_vpn_sites_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_operations.py new file mode 100644 index 000000000000..a59e5a38a535 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_vpn_sites_operations.py @@ -0,0 +1,523 @@ +# 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 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 + +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_06_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_06_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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_06_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_06_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 + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **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_06_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_06_01.models.VpnSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VpnSite"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.ListVpnSitesResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListVpnSitesResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_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 new file mode 100644 index 000000000000..d4cf576381cd --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_web_application_firewall_policies_operations.py @@ -0,0 +1,405 @@ +# 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 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 + +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_06_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_06_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.WebApplicationFirewallPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicyListResult"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + 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_06_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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'] = 'application/json' + + 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_06_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_06_01.models.WebApplicationFirewallPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WebApplicationFirewallPolicy"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "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'] = 'application/json' + + 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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # 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] + + 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, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **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_06_01/py.typed b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file